#include <stdio.h>
int n, a[100], t;
int main() {
	while(true) {
		scanf("%d", &n);
		if(n == 0) break;
		for(int i = 0; i < n; i++) scanf("%d", &a[i]);
		scanf("%d", &t);
		int c = 1;
		int l = 0;
		int r = n - 1;
		while(r - l > 0) {
			int m = (l + r) / 2;
			if(a[m] == t) break; c++;
			if(a[m] < t) {
				l = m + 1;
			}
			else {
				r = m - 1;
			}
		}
		printf("%d\n", c);
	}
	return 0;
}