#include <iostream>
#include "unordered_map"
using namespace std;
int main() {
int n;
while (cin >> n) { // 注意 while 处理多个 case
if(n==0) break;
unordered_map<int,int> myMap;
while(n--){
int temp;
cin>>temp;
myMap[temp]++;
}
int ask;
cin>>ask;
auto it=myMap.find(ask);//使用迭代器查询相比于使用下标查询优势在于当查询对象不存在时不会插入一个默认对象
int num=0;
if(it!=myMap.end()) num=it->second;
cout<<num<<endl;
}
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号