We have *n* points (*x* _{ i}, *y* _{ i}). Let both *x* and *y* be different and from [1, *n*].

Initially, all points have zero value.

Two types of queries:

1) add X — adding +1 to all points with *x* _{ i} ≤ *X*

2) sum Y — calculate sum of values of points with *y* _{ i} ≤ *Y*

What is best known solution? (Problem not from running contest).