#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
using namespace std;

int main()
{
	int a;
	while (cin >> a, a) {
		int b[100];
		for (int c = 0; c < a; c++)cin >> b[c];
		int d;
		cin >> d;
		int MIN = 0, MAX = a - 1, sum = 1;
		while (1) {
			int e = (MIN + MAX) / 2;
			if (MIN==MAX)break;
			if (MIN + 1 == MAX) { sum++; break; }
			if (b[e] < d)MIN = e+1;
			else if (b[e] > d)MAX = e-1;
			else break;
			sum++;
		}
		cout << sum << endl;
	}
}