#include<iostream>
using namespace std;
int n,t[100],a,L,R,M,ans;
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++){
      cin>>t[i];
    }
    cin>>a;

    L=0;
    R=n-1;
    ans=0;
    while(L<=R){
      M=(L+R)/2;
      ans++;
      //cout<<t[M]<<endl;
      if(t[M]==a){
	break;
      }else if(t[M]>a){
	R=M-1;
      }else{
	L=M+1;
      }
    }
    cout<<ans<<endl;
  }
  
  return 0;
}