#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>

using namespace std;


int main(){

	int n;
	while(1){
		cin>>n;if(n==0)break;
		int P[105]={};
		for(int i=0;i<n;i++){
			cin>>P[i];}

		sort(P,P+n);
		int C=0;
		int x;
		cin>>x;
		int H=(n-1)/2;
		int L=n-1,S=0;
		while(1){
			//cout<<L<<" "<<S<<endl;
			if (L==S){
				//cout<<"%";
				C++;break;
			}
			if (P[H]==x){C++;break;}

			else if(P[H]<x){S=H+1;
			H=(S+L)/2;C++;//cout<<"#";//cout<<H<<endl;//break;
			}
			else if(P[H]>x){L=H-1;
				H=(S+L)/2;C++;//cout<<"$";//cout<<H;//break;
			}
			
		}
		cout<<C<<endl;
	}
	return 0;
}
		