//43
#include<iostream>

using namespace std;

int main(){
  for(int n;cin>>n,n;){
    int a[100];
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    int ans=1;
    int f=0,l=n-1;
    int g;
    cin>>g;
    for(;;ans++){
      int m=f+(l-f)/2;
      if(a[m]==g||l-f==0){
	break;
      }else if(a[m]>g){
	l=m-1;
      }else{
	f=m+1;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}