- Time limit: 2.00 s
- Memory limit: 512 MB
Uolevi recently got a job as a kangaroo keeper. Unfortunately, some of his kangaroos immediately escaped, and Uolevi is in pursuit.
The kangaroo farm has different kinds of kangaroos, where the 'th type of kangaroo moves exactly meters per jump. To find the escaped kangaroos, Uolevi wants to calculate the amount of kangaroo footprints in the interval of the road. When a kangaroo of type escapes, it leaves a footprint at positions along the road, where is a positive integer.
There are two kinds of events that can happen:
- A kangaroo of type escapes, leaving footprints at positions , , and so on
- Uolevi counts the number of footprints in the interval .
Can you find the number of footprints Uolevi counts on each interval?
Input
The first line of input contains three integers , and : the length of the road, the amount of kangaroo types, and the number of events.
After this, lines follow, each of one of the two following types:
- : A kangaroo of type escapes, leaving footprints at positions , where is a positive integer
- : Uolevi counts the amount of footprints in the interval
Output
Print lines where is the amount of queries of type . On every such line, print the amount of footprints on the interval.
Constraints
Example
Input:
5 5 5 1 1 1 3 2 2 4 1 2 2 4 5
Output:
4 3