AT_abc451_c [ABC451C] Understory
Description
Takahashi is managing the number of trees in his garden. Initially, there are no trees in the garden.
$ Q $ queries are given in order. Each query is one of the following two types. Immediately after processing each query, output the number of trees currently in the garden.
- `1 h` : Add one new tree of height $ h $ to the garden.
- `2 h` : Remove all trees currently in the garden whose height is at most $ h $ .
Input Format
The input is given from Standard Input in the following format:
> $ Q $ $ \text{query}_1 $ $ \text{query}_2 $ $ \vdots $ $ \text{query}_Q $
$ \text{query}_i $ , representing the $ i $ -th query, is one of the following two types:
> $ 1 $ $ h $
> $ 2 $ $ h $
Output Format
Output $ Q $ lines.
The $ i $ -th line should contain the number of trees in the garden immediately after processing the $ i $ -th query.
Explanation/Hint
### Sample Explanation 1
The number of trees changes as follows.
- A tree of height $ 5 $ is added. The garden contains one tree of height $ 5 $ .
- A tree of height $ 7 $ is added. The garden contains two trees of heights $ 5, 7 $ .
- A tree of height $ 8 $ is added. The garden contains three trees of heights $ 5, 7, 8 $ .
- Trees of height at most $ 7 $ are removed. The garden contains one tree of height $ 8 $ .
- A tree of height $ 3 $ is added. The garden contains two trees of heights $ 8, 3 $ .
### Constraints
- $ 1 \le Q \le 3 \times 10^5 $
- $ 1 \le h \le 10^9 $
- All input values are integers.