#include <iostream>
#include <vector>
using namespace std;
#define REP(i, n)           for(int(i)=0;(i)<(n);++(i))
typedef vector<int> VI;
#define pb                  push_back

int solve(VI vi, int t){
    int l = 0, r = vi.size()-1, cnt = 0;
    while(l<=r){
        int c = (l+r)/2;
        cnt++;
        if(vi[c] < t){ l = c+1; continue; }
        if(vi[c] > t){ r = c-1; continue; }
        break;
    }
    return cnt;
}

int main(void){
    int n, m;
    while(cin >> n && n){
        VI vi;
        REP(i,n){
            cin >> m;
            vi.pb(m);
        }
        cin >> m;
        cout << solve(vi, m) << endl;
    }
    return 0;
}