#include <stdio.h>

int main() {
	int n;
	while (scanf("%d",&n) != EOF) {
		if(n==0) break;
		int score[n],goal,count=0;
		for(int i=0; i<n; i++) {
			scanf("%d",&score[i]);
		}
		scanf("%d",&goal);
		for(int i=0; i<n; i++) {
			if(score[i]==goal){
				count++;
			}
		}
		printf("%d\n",count);
	}
	return 0;
}