#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <bitset>
#include <string>
using namespace std;
 
#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)
#define PB(a) push_back(a)
#define MP(i,s) make_pair(i,s)
 
typedef long long ll;

const int MAX_N = 101;
int N, k;
int a[MAX_N];

void solve() {
	sort(a, a+N);
	int c = 0;
	int l = 0;
	int r = N-1;
	do {
		c++;
		int mid = (l + r) / 2;
		if(a[mid] == k) {
			break;
		}
		else if(a[mid] < k) {
			l = mid+1;
		}
		else if(a[mid] > k) {
			r = mid-1;
		}
	} while(l <= r);
	printf("%d\n", c);
}

int main() {
	while(scanf("%d", &N), N) {
		rep(i,N) scanf("%d", &a[i]);
		scanf("%d", &k);
		solve();
	}
}