Strange multiset
题号:NC207456
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

There was a strange person who gave you a strange multiset which had a chip in it.

Initially, the multiset is empty. just like what it was called, for sure you can add some integers into it , delete intergers or ask its size.But the chip inside the multiset will convert the value you give  by running a function and getting return value.
funtion shows in the picture below.

Now, you have to deal with q queries .A query has three types of operations.

operation 1 :  ask the size of the multiset.

operation 2:  add an integer X into the multiset

operation 3:  delete all integers that equal to the integer X from the multiset

Note that the multiset will always run the function through its chip and use the value of the function as final integer when you implement operation 2 or operation 3.

输入描述:

First line contains a integer q --- number of queries.()

The following q lines contain operations.

There are three types of operations,()

The ask operations given as "1".

The add operations given as "2 X".

The delete operations given as "3 X".

输出描述:

For every ask operations , you should output an integer representing the size of the current multiset

示例1

输入

复制
5
2 9
2 15
1
3 21
1

输出

复制
2
0