#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n, n) {
		int a[110]; int k;
		for (int i = 0; i < n; i++)cin >> a[i]; cin >> k;
		int l = 0, r = n - 1;
		int cnt = 0;
		while (l <= r) {
			cnt++;
			int m = (l + r) / 2;
			if (a[m] == k) { cout << cnt << endl; goto heaven; }
			else if (a[m] < k)l = m + 1;
			else if (a[m] > k)r = m - 1;
		}
		cout << cnt << endl;
	heaven:;
	}
}
