#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int a[200];
int main() {
	int n;
	while (scanf("%d", &n), n) {
		rep(i, n)scanf("%d", &a[i]);
		int search; scanf("%d", &search);
		int s = 0, g = n - 1;
		int cnt = 0;
		while (s <= g) {
			cnt++;
			if (a[(s + g) / 2] == search)break;
			if (a[(s + g) / 2] < search)s = (s + g) / 2 + 1;
			else g = (s + g) / 2 - 1;
		}
		printf("%d\n", cnt);
	}
}