#include<stdio.h>
int main(void)
{
	int n,m;
	int a[101];
	int high,low,key;
	int cnt=0;
	int i,j;

	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<n;i++){
			scanf("%d",&a[i]);
		}
		scanf("%d",&m);
		cnt=0;
		low=0;
		high=n-1;
		while(high>=low){
			cnt++;
			key=(high+low)/2;
			if(a[key]==m){
				break;
			}
			else if(a[key]>m){
				high=key-1;
			}
			else {
				low=key+1;
			}
		}
		printf("%d\n",cnt);
		scanf("%d",&n);
	}
	return 0;
}