#include <iostream>
using namespace std;

int main() {
    int n;int cul=0;
    while(scanf("%d",&n)!=EOF){
        if(n==0)break;
        int a[n];
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        int m;cin>>m;
        for(int i=0;i<n;i++){
            if(a[i]==m)cul=cul+1;
        }
        cout<<cul<<endl;
        cul=0;
    }
}