#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int n,s;
	int a[101];
	while(cin >> n){
		if(n == 0)break;
		for(int i = 0; i < n; i++) cin >> a[i];
		cin >> s;

		int left = 0,right = n-1;
		int cnt = 0;
		while(1){
			if(left > right)break;
			int mid = (left + right) / 2;
			cnt++;
			if(a[mid] == s){
				break;
			}
			else if(a[mid] < s){
				left = mid + 1;
			}
			else
				right = mid - 1;
		}
		printf("%d\n",cnt);
	}
	return 0;
}