#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main( void )
{
	int n;
	while ( cin >> n && n )
	{
		vector <int> values;
		for ( int i = 0; i < n; i++ )
		{
			int v;
			cin >> v;
			values.push_back( v );
		}

		sort( values.begin(), values.end() );

		int s;
		cin >> s;

		int left  = 0;
		int right = n - 1;
		int answer = 0;
		while ( left <= right )
		{
			int m = ( left + right ) / 2;
			if ( s == values[m] )
			{
				answer++;
				break;
			}
			else if ( s > values[m] )
			{
				left = m + 1;
				answer++;
			}
			else if ( s < values[m] )
			{
				right = m - 1;
				answer++;
			}
		}

		cout << answer << endl;
	}
	return 0;
}