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

int a[110];
int n, k;

//a[0], a[1], a[2]. ... , a[n - 1]?????????x?????????????????????????????????
int binary_search(int x){
    int res = 0;
	int l = 0, r = n - 1;
	//[l, r)???????????????????????????????????§??°?????????
	while(r - l >= 1){
		int m = (l + r) / 2;
        res++;
		if(a[m] == x) return res; //x??????????????£?????´???
		else if(a[m] > x) r = m - 1;
		else if(a[m] < x) l = m + 1;
	}
	//x???????????????????????£?????´???
	return res + 1;
}

int main(){
    while(cin >> n, n){
        for(int i = 0; i < n; i++){
            cin >> a[i];
        }
        cin >> k;
        sort(a, a + n);
        cout << binary_search(k) << endl;
    }
}