#include<iostream>
#include<algorithm>
using namespace std;

typedef long long ll;
int n, ans;

int binary_search(ll k, ll a[]) {
	int l = 0, r = n - 1;
	while (r - l >= 0) {
		ans++;
		int mid = (l + r) / 2;
		if (k == a[mid]) return ans;
		else if (k < a[mid]) r = mid - 1;
		else l = mid + 1;
	}
	return ans;
}
int main() {
	while (cin >> n && n) {
		ans = 0;
		ll k, a[100];
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		sort(a, a + n);
		cin >> k;
		cout << binary_search(k, a) << endl;
	}
}
