A list of integers is given. For each of $Q$ queried values, print how many times it appears in the list.
Input
Line 1: the list. Line 2: $Q$. Next $Q$ lines: a value each.
Output
Print the count for each query, one per line.
Example 1
Input
1 2 1 3 1 2 3 1 2 4
Output
3 2 0
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.