#include <stdio.h>
main(){
  int a,n[100],i,key,l=0,r=100,mid,c=0;
  while(1){
    scanf("%d",&a);
    if(a==0) break;
    for(i=0;i<=a;i++){
      scanf("%d",&n[i]);
    }
    key=n[a];
    r=a-1;
    if(l!=r){  
      while(1){
	mid=(l+r)/2;
	c++;
	if(n[mid]==key) break;
	else if(n[mid]<key) l=mid+1;
	else r=mid-1;
      }
    }
    else c=1;
    printf("%d\n",c);
  } 
  return 0; 
}