Problem R
Radicalists
Languages
en
is

Disagreements sometimes arise in the Icelandic Competitive Programming Society when discussing problems for upcoming programming contests. Recently these disagreements have gotten somewhat out of hand and resulted in the group splitting up when writing problems to avoid confrontation.
As an example recently the group split in two when a portion of the problem writers got sick and tired of all the League of Legends problems and said that the rest of the society was hopelessly addicted to this boring video game.
This worked for some time until disagreements arose again, that time some people from both groups complained that the addiction to Runescape among some members was no better, so both groups split once more and then there were four.
This was starting to get hard to track. Thus we now need a program that can maintain the state of things as groups keep splintering due to groups of radicalists splitting off from any group they are in.
Input
The first line of input contains two positive integers
If the line starts with a r there
will follow a positive integer
If the line starts with s the program should print the number of groups the society is currently split into, printing that number on its own line. Empty groups do not count.
Finally if the line starts with m
there will follow a single positive integer
Output
For each query starting with s or
m the program should print one line,
as described above. There will be at most
Scoring
Group |
Points |
Constraints |
1 |
10 |
|
2 |
20 |
|
3 |
30 |
|
4 |
20 |
|
5 |
20 |
|
Sample Input 1 | Sample Output 1 |
---|---|
7 8 r 3 1 4 6 r 4 2 3 4 6 m 2 r 2 4 6 m 4 m 7 r 1 1 s |
3 2 6 4 7 5 4 |