import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            if (n == 0) break;
            int[] scores = new int[n];
            for (int i = 0; i < n; i++) {
                scores[i] = scanner.nextInt();
            }
            int target = scanner.nextInt();
            int ans = 0;
            for (int score : scores) {
                if (score == target) {
                    ans++;
                }
            }
            System.out.println(ans);
        }
    }
}