List of Strings

Limits 1s, 512 MB

Initially you have an empty list DD. In this problem you will be asked to execute three types of queries. The query types are described below.

Input

The first line of the input will contain a single integer QQ. Each of the next QQ lines will contain one of the three types of queries as below.

Constraints:\textbf{Constraints:}

For Subtask #1 (10 points):

For Subtask #2 (90 points):

Output

For query type 33, print the number of such strings in a single line.

Samples

InputOutput
5
1 aa
1 aaa
1 aaaa
2 2 2
3 1 3
2
InputOutput
8
1 abc
1 defg
3 1 2
1 hijkl
3 2 3
2 2 1
2 2 3
3 2 3
2
2
3

After executing the 7th7^{th}query, the list is DD == [ “abc“, ““,”hijkl” ]. So, the answer to the 8th8^{th}query is 33.