PotatoDB v1.0

Limits 1s, 512 MB

You are building a new database software: PotatoDB.

PotatoDB is meant to store numbers and handle the following queries:

Note that the same number may be stored multiple times in the database and you will have to count each instance of those numbers separately. If the number “100” is added twice, then count them as two numbers.

Input

The input will start with QQ (1Q10001 \le Q \le 1000). QQ is the number of queries that will follow, one per line. The queries will follow the following format:

Output

For each query, print the response from the database:

Sample

InputOutput
5
A 10
A 10
S 1
D 10
S 2
1
2
2
1
0