#include<iostream>
using namespace std;
int main()
{
    int n,k,l,r,cnt,a[110];
    while(cin >> n,n!=0){
        for(int i=0;i<n;i++) cin >> a[i];
        cin >> k;
        l = 0;
        r = n-1;
        cnt = 0;
        while(l <= r){
            cnt++;
            int mid = (l+r)/2;
            if(k == a[mid]) break;
            if(k < a[mid]) r = mid-1;
            if(a[mid] < k) l = mid+1;
        }
        cout << cnt << endl;
    }
    return 0;
}

