Starting from:

$30

Making the SPARTAN

Making the SPARTAN
The SPARTAN-II program has been restarted and needs to get more soldiers out as the war is starting to
look bad for the humans. Dr.Catherine Halsey has decided that instead of the normal procedure of
choosing the survivors of the tests of the SPARTAN-II program it would be better to administer a more
continuous evaluation of the candidates and disqualify the ones which fail to meet the mark.
In the new system each soldier gets an evaluation when he is selected to enroll. Throughout the course of
the program they need to keep improving their score, which will be recorded at the next evaluation. Every
soldier who does not meet the standard will be discarded at that evaluation. Only those who remain will
get to be called SPARTAN-II commandos.
Help Dr.Catherine decide the eligible candidates who remain at the end.
Input Format
The first line of the input is a number , which is the number candidates enrolled.
The next lines are of the format
where is the name of the candidate and is the original evaluation of the candidate.
The next line is a number , which is the number of subsequent lines in the input.
The next lines can be of types
, which tells that the score of candidate has improved by
, which tells that an evalauation has been conducted with a standard . All candidates with score less
than will be disqualified in this evaluation.
Constraints
Output Format
The output should contain the number of qualifying soldiers for each query of type .
Sample Input 0
2
SPARTAN-B312 1000
John-117 1000
3
1 SPARTAN-B312 200
1 John-117 300
2 1100
Sample Output 0
2
Sample Input 1
2
Jun-A266 600
SPARTAN-B312 1000
3
1 Jun-A266 400
1 SPARTAN-B312 200
2 1100
Sample Output 1
1
Sample Input 2
6
Carter-A259 950
Catherine-B320 800
Jun-A266 850
Emile-A239 900
Jorge-052 850
SPARTAN-B312 1000
10
1 Carter-A259 350
1 Catherine-B320 300
1 Jun-A266 300
1 Emile-A239 250
1 Jorge-052 250
1 SPARTAN-B312 200
2 1100
1 Carter-A259 200
1 SPARTAN-B312 300
2 1200
Sample Output 2
6
2

More products