#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

int n,a[100],t;

int main(){
	while(cin>>n&&n){
		rep(i,n)cin>>a[i];
		cin>>t;
		int lb=0,ub=n-1;
		int ans=0;
		while(++ans){
			//cout<<ans<<" "<<a[lb]<<" "<<a[ub]<<" "<<a[(lb+ub)/2]<<endl;
			if(a[(lb+ub)/2]==t){cout<<ans<<endl;break;}
			else if(a[(lb+ub)/2]<t)lb=(lb+ub)/2+1;
			else ub=(lb+ub)/2-1;
			if(lb>ub){cout<<ans<<endl;break;}
		}
	}
}