#include <iostream>
#include <algorithm>

using namespace std;

int binary_search(int a[],int k,int n) {
	int l = 0, r = n-1, cnt=0;

	while (r - l >= 0) {
		int m = (l + r) / 2;
		cnt++;
		if (a[m] == k) return cnt;
		else if (a[m] > k) {
			r = m-1;
		}
		else if (a[m] < k) {
			l = m + 1;
		}
	}

	return cnt;
}

int main() {
	
	int n;

	while (cin>>n) {

		int a[100010], k, ans;

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

		cin >> k;

		ans=binary_search(a, k, n);

		cout << ans<<endl;
	}
}