#include <iostream>
using namespace std;

int main(){
	int n,key,a[101];
	while( cin >> n , n ){
		for(int i=0 ; i<n ; ++i ){
			cin >> a[i];
		}
		cin >> key;
		bool flag = true;
		int begin = 0;
		int end = n-1;
		int cnt = 1;
		for( ; flag && begin != end ; ++cnt ){
			int pos = (begin+end)/2;
			int val = a[pos];
			if( key == val ){
				flag = false;
			}else{
				if( key < val ){
					end = pos-1;
				}else{
					begin = pos+1;
				}
			}
		}
		cout << cnt << endl;
	}
}