#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<bitset>
#include<functional>
#include<climits>
using namespace std;
typedef pair<int,int>pii;
const int INF=1e9;
const int dx[]={0,-1,0,1},dy[]={-1,0,1,0};



int main(){
    int n;
    while(cin>>n,n){
        int v[100];
        for(int i=0;i<n;i++)cin>>v[i];
        int t;cin>>t;
        int ub=n-1,lb=0;
        int cnt=0;
        bool flag=true;
        while(ub>=lb){
            cnt++;
            int mid=(ub+lb)/2;
            if(v[mid]>t)ub=mid-1;
            else if(v[mid]<t)lb=mid+1;
            else if(v[mid]==t){
                cout<<cnt<<endl;
                flag=false;
                break;
            }
        }
        if(flag)cout<<cnt<<endl;
    }
    return 0;
}