#include <iostream>
using namespace std;

int main(void){
	int i,n,x[104],search;
	int l,r,c;
	int count;

	while(cin>>n && n){
		for(i=0;i<n;i++) cin>>x[i];
		cin>>search;

		for(count=l=0,r=n-1,c=(l+r)/2;l<=r;c=(l+r)/2,count++){
			if(search < x[c]) r = c - 1;
			else if(search > x[c]) l = c + 1;
			else{count++; break;}
		}
		cout<<count<<endl;
	}

	return 0;
}