#include <iostream>
#include <cstdio>
using namespace std;

#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)

int n, l[100], t;

void solve() {
  rep(i,n) cin>>l[i];
  cin>>t;
  
  int lb = 0, ub = n-1, res = 0;
  while (1) {
    res++;
    if (ub == lb) {
      //printf("lb=%d ub=%d\n", lb, ub);
      break;
    }
    int md = (lb+ub)/2;
    //printf("lb=%d ub=%d md=%d\n", lb, ub, md);
    if (l[md] < t) {
      lb = md + 1;
    } else if (l[md] > t) {
      ub = md - 1;
    }
  }
  cout<<res<<endl;
}

int main (int argc, char const* argv[]) {
  while (cin>>n, n) {
    solve();
  }
  return 0;
}