e-olymp
Problems

Mutants

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 109 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 (0n105) in the Institute. The next line contains n non-decreasing non-negative integers not exceeding 109 - their colors. The third line contains the number of requests m (1m100000) for your program. The next line contains m non-negative integers (not exceeding 109 + 1).

Output

Print m lines. For each query, print the number of animals of the given color in the nursery.

Time limit 1 second
Memory limit 128 MiB
Input example #1
10
1 1 3 3 5 7 9 18 18 57
5
57 3 9 1 179
Output example #1
1
2
1
2
0