#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()
const int MAX = 110;

int main()
{
    int n;
    while(cin >> n && n)
    {
        int num[MAX] = {};
        int des;
        REP(n) cin >> num[i]; 
        cin >> des;

        int ls = 0, rs = n - 1, ans = 0, cen = 0;
        while(1)
        {
            //cout << "center = " << (ls + rs) / 2 << endl;
            if(ls > rs) break;
            ans++;
            cen = (ls + rs) / 2;
            if(num[cen] == des) break;
            if(num[cen] < des) ls = cen + 1;
            else rs = cen - 1;

        }
        cout << ans << endl;
    }

    return 0;
}