//copy #1124820 

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
 
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

int main (void) {
    int n;
    int a[100];
    while(cin>>n && n){
        rep(i,n)cin>>a[i];
        int f;
        cin>>f;
        int l=0; int r=n-1;
        int ans=0;
        while(l<=r) {
            ans++;
            int m=(l+r)/2;
            if(a[m] == f) break;
            else if(a[m]<f)l=m+1;
            else r=m-1;
            m=(l+r)/2;
        }
        cout << ans << endl;
    }
    return 0;
}