#include <iostream>

using namespace std;

#define MAX_N 101

int a[MAX_N];

int main() {
    int n, f;
    while (cin >> n) {
        if (n == 0) break;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        cin >> f;
        int count = 0;
        int r = n-1, l = 0;
        int mid;
        while (true) {
            mid = (r+l) / 2;
            if (r < l) break;
            count++;
            if (a[mid] == f) {
                 break;
            }
            if (r == l) break;
            if (a[mid] < f) {
                l = mid+1;
            }
            if (a[mid] > f) {
                r = mid-1;
            } 
        }
        cout << count << endl;
    }
    return 0;
}