#include<iostream>
using namespace std;

int main() {
	int n, a[100], f, l, r, ans, piv;
	while(1) {
		cin >> n;
		if(!n) break;
		for(int i=0; i<n; ++i) cin >> a[i];
		cin >> f;
		l = 0; r = n-1; ans = 0;
		while(l<=r) {
			piv = (l+r)/2;
			ans++;
			if(a[piv]==f) {
				break;
			}
			if(a[piv]<f) {
				l = piv+1;
			}else {
				r = piv-1;
			}
		}
		cout << ans << endl;
	}
	return 0;
}