Mutants
For a long time in the Institute of Arts, Mutants and Information Technologies, cute colorful animals are bred. For convenience, each color is designated by its own number, there are no more than 10^9
colors in total. One of the beautiful days a miracle happened in the nursery: all the animals were lined up in a row in ascending order of colors. Taking this opportunity, the laboratory assistants decided to count how many animals of different colors live in the nursery, and, according to the law of the genre, they asked you to write a program that will help them in solving this difficult task.
Input
The first line contains the number of animals n (0 ≤ n ≤ 10^5
) in the Institute. The next line contains n non-decreasing non-negative integers not exceeding 10^9
- their colors. The third line contains the number of requests m (1 ≤ m ≤ 100000) for your program. The next line contains m non-negative integers (not exceeding 10^9
+ 1).
Output
Print m lines. For each query, print the number of animals of the given color in the nursery.