#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()

int main()
{
    int n;
    while(cin >> n && n)
    {
        vector<int> num;
        int t, des;
        REP(n){ cin >> t; num.push_back(t);}
        cin >> des;

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

            if(num[(ls + rs)/2] < des) ls = (ls + rs) / 2 + 1;
            else rs = (ls + rs) / 2 - 1;
        }
        cout << ans << endl;
    }

    return 0;
}