#include <iostream>
using namespace std;

int main() {
  int hi,lo,m,n,a,i,k,d[100];
  while(cin >> n && n!=0) {
	  for (i=0;i<n;i++) cin >> d[i];
	  cin >> a;
	  hi=n-1; lo=k=0;
	  while(true) {
	  k++; m=(hi+lo)/2; 
	  if (d[m]<a) lo=m+1; else if (d[m]>a) hi=m-1; else break;
	  if (hi==lo) { k++; break;}
	   }
	  cout << k << endl;
  }
  return 0;
}	