#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	int t[110];

	while (cin >> n, n) {
		for (int i = 0; i < n; i++) {
			cin >> t[i];
		}

		int x;
		cin >> x;

		int l = 0;
		int r = n - 1;
		int cnt = 0;

		while (l <= r) {
			cnt++;
			int m = (l + r) / 2;

			if (t[m] == x)
				break;
			if (t[m] > x) {
				r = m - 1;
			} else {
				l = m + 1;
			}
		}

		cout << cnt << endl;
	}
}