K. Ka3bool's Birthday
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Ka3bool is a very smart cat, he loves programming as much as his owner Manar does, he's also known for being a cp weapon. One day, Ka3bool challenged Manar's friend with a problem that goes as follows: "meow meow meow, meow meoow.. meowww".

The friend did not understand anything of what that silly cat said, so she asked Manar to translate it for her, and she was happy to do so.

Ka3bool

Let $$$S$$$ be a set of distinct integers, and let $$$f(S)$$$ be the number of non-intersecting intervals of integers in this set. For example, if $$$S = \{1, 2, 4, 5, 6, 8\}$$$, then $$$f(S) = 3$$$, since the non-intersecting intervals are $$$[(1, 2), (4, 6), (8)]$$$.

The set is empty at first, and you have to make $$$q$$$ changes of the following form:

  • + $$$x$$$, add an integer $$$x$$$ to the set.
  • - $$$x$$$, delete an integer $$$x$$$ from the set. It's guaranteed that $$$x$$$ is already in the set.

After each change, you have to tell Ka3bool the value of $$$f(S)$$$.

Input

The first line of the input contains one integer $$$q (1 \leq q \leq 10^6)$$$ — the number of changes.

Then $$$q$$$ lines follow. The $$$i$$$-th line contains a character $$$c$$$ and an integer $$$x$$$ where ($$$c \in$$$ {+, -}) and $$$(0 \leq x \leq 10^{18})$$$.

Output

After each change, output a single integer $$$f(S)$$$ — the number of non-intersecting intervals.

Example
Input
8
+ 0
+ 6
+ 1
- 0
+ 3
+ 4
+ 5
- 5
Output
1
2
2
2
3
3
2
3