#include<iostream>
using namespace std;

int binSearch( int*, int, int, int, int );

int main(){
	int n;	// number
	int s;	// search
	int data[100];
	while(1){
		cin >> n;
		if( n == 0 ) break;

		for( int i=0; i<n; i++ ){
			cin >> data[i];
		}
		cin >> s;

		cout << binSearch( data, s, 0, n-1, 0 ) << endl;
	}
	return 0;
}

int binSearch( int *data, int s, int first, int last, int comp ){
	comp++;
	if( first >= last ){
		return comp;
	}
	int p = (first+last)/2;
	if( data[p] < s ){
		return binSearch( data, s, p+1, last, comp );
	}else if( data[p] > s ){
		return binSearch( data, s, first, p-1, comp );
	}else{
		return comp;
	}
}