Mishki is quite interested in playing games, and recently she found an empty stack. Now she wants to perform 3 types of operations on the stack:
1 : push element A in the stack.
2 0 : pop one element from stack.
3 : find how many elements were less than X present in the stack, after performing operation on the stack.
Can you help her in performing the above operations ?
Input:
The first line contains an integer N, denoting the number of operations.
Next N line contains, any of the 3 types of operations mentioned above, where line contains the operation.
Output
Print the required answer for each of the type of operation, in new line.
Constraints:
Notes:
1) No pop operation will be given for an empty stack.
2) Let's say, you are performing operation on the stack and it is of type, then the given K will always be less than i.
3) There will be at least one type of operation, in the input.
In operation you need to find the values present in the stack which were less than , after performing operation. So the answer is 2.
In operation you need to find the values present in the stack which were less than 5 , after performing operation. So the answer is 2.
In operation you need to find the values present in the stack which were less than 5 , after performing operation. So the answer is 1.