By Kay Akashi
You are given an array consisting of integers , …, . Then in each of lines you are given an integer and an operation: "LARGER" or "SMALLER". If the operation is "LARGER", your task is to output the number of elements in that are STRICTLY larger than . If the operation is "SMALLER", your task is to output the number of elements in that are STRICTLY smaller than .
. Neither element in nor is smaller than and larger than .
. Neither element in nor is smaller than and larger than .
The first line of input contains one integer, . The second line contains integers that compose an array . The theird line of input contains one integer, . Following are lines each of which contains an integer and an operation which is either "LARGER" or "SMALLER".
Output the answers in lines.
5
18 19 -130 6 100
4
18 LARGER
-1000 SMALLER
-300 LARGER
0 SMALLER
2
0
5
1