#include<iostream>
using namespace std;

int binarySearch( int l, int r, int k, int* a )
{
    int cnt = 0;
    while( l <= r )
    {
        cnt++;
        int mid = ( l + r ) / 2;
        if( k < a[mid] )
            r = mid - 1;
        else if( k > a[mid] )
            l = mid + 1;
        else
            return cnt;
    }
    return cnt;
}

int main()
{
    int n, a[100], key;

    while( cin >> n )
    {
        if( n == 0 )
            break;

        for( int i = 0; i < 100; i++ )
            a[i] = 0;

        for( int i = 0; i < n; i++ )
            cin >> a[i];
        
        cin >> key;

        int left = 0, right = n - 1;
        cout << binarySearch( left, right, key, a ) << endl;
    }
    return 0;
}

