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


int main(){
    int n, search;
    while (cin >> n && n){
	int inp[101];
	for (int i = 0; i < n; i++) cin >> inp[i];
	cin >> search;
	
	int ans = 0;
	int e = n - 1, s = 0;
	int p = (e - s) / 2;

	while (s <= e){
	    ans++;
	    if (inp[p] == search) break;
	    if (inp[p] > search) e = p - 1;
	    else s = p + 1;

	    p = (s + e) / 2;
	}

	cout << ans << endl;
    }
}