#include <iostream>
#include <string>
#include <vector>
using namespace std;

int v[100];

int main() {
    int n;
    while (cin >> n, n) {
        for (int i=0; i<n; ++i) {
            cin >> v[i];
        }
        int search;
        cin >> search;
        int l = 0, h = n-1, res = 0;
        while (l <= h) {
            int mid = (l + h) / 2;
            ++ res;
            if (v[mid] == search) {
                break;
            } else if (search < v[mid]) {
                h = mid-1;
            } else {
                l = mid+1;
            }
        }
        cout << res << endl;
    }
    return 0;
}