An array of size n consisting of sorted elements is given.
You are given m queries. For each query, you need to find how many times the number x appears in the array.
The first line contains a natural number, n(1≤n≤105).
The second line consists of n numbers separated by spaces, ai(1≤ai≤109).
The third line contains a natural number, m(1≤m≤105).
The next m lines contain numbers separated by spaces, xi(1≤xi≤109).
Output the answer for each query in m lines.
10 1 1 2 3 3 3 5 7 8 9 7 1 2 3 4 5 10 1
2 1 3 0 1 0 2
Login to be able to submit.