#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define DEBUG(x) cerr << #x << " = " << x << endl
int A[100];
int main() {
  while(true) {
    int N; cin >> N;
    if(N == 0) break;
    REP(i,N) cin >> A[i];
    int t; cin >> t;
    int lb = 0, ub = N - 1;
    int c = 0;
    while(ub >= lb) {
      int mid = (lb + ub) / 2;
      //DEBUG(lb);
      //DEBUG(ub);
      //DEBUG(mid);
      ++c;
      if(A[mid] == t) {
        break;
      }
      if(t < A[mid]) {
        ub = mid - 1;
      }
      else {
        lb = mid + 1;
      }
    }
    cout << c << endl;
  }
}