1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 int main() { 6 int n; 7 cin >> n; 8 map<int, int> mp; 9 for (int i = 0; i < n; ++i) { 10 int x; 11 cin >> x; 12 mp[x]++; 13 } 14 15 int q; 16 cin >> q; 17 for (int i = 0; i < q; ++i) { 18 int x; 19 cin >> x; 20 if (mp.find(x) != mp.end()) { 21 cout << mp[x] << endl; 22 } else { 23 cout << 0 << endl; 24 } 25 } 26 27 return 0; 28 } 29