fork download
  1. # your code goes here
  2. n=int(input())
  3. arr=[int(input()) for i in range(n)]
  4. q=int(input())
  5. for j in range(q):
  6. query=int(input())
  7. count=0
  8. for k in range(0, n):
  9. if arr[k]==query:
  10. count+=1
  11. print(count)
Success #stdin #stdout 0.11s 14168KB
stdin
5
1
1
1
1
1
2
1
2
stdout
5
0