#include <iostream>
using namespace std;

int main() {
  int n, t, l, r, m, c;
  int a[100];
  while (1) {
    cin >> n;
    if (!n) break;
    for (int i=0; i<n; i++) {
      cin >> a[i];
    }
    cin >> t;
    l = 0;
    r = n-1;
    c = 0;
    while (l <= r) {
      m = (l + r) >> 1;
      ++c;
      if (a[m] > t) {
        r = m - 1;
      } else if (a[m] < t) {
        l = m + 1;
      } else {
        break;
      }
    }
    cout << c << endl;
  }
  return 0;
}