#include<iostream>
using namespace std;
int main(){
long n,a[100],b,s,m,e,i,j;
while(cin>>n){
if(n==0)break;
for(i=0;i<n;i++)cin>>a[i];
cin>>b;
s=0;e=n-1;
for(j=1;;j++){
m=(s+e)/2;
if(a[m]==b)break;
else if(a[m]<b)s=m+1;
else e=m-1;
if(e<s)break;
}
cout<<j<<endl;
}
return 0;
}