#include <stdio.h>

int main(void)
{
	int n;
	int i;
	int a[128], key;
	int left, right, center;
	int count;
	
	while (scanf("%d", &n) && n){
		for (i = 0; i < n; i++){
			scanf("%d", &a[i]);
		}
		scanf("%d", &key); //探す数
		
		left = 0;
		right = n - 1;
		count = 0;
		while (l <= r){
			center = (l + r) / 2;
			
			count++;
			if (a[center] == key){
				break;
			}
			else if (a[center] > key){
				right = center - 1;
			}
			else {
				left = center + 1;
			}
		}
		printf("%d\n", count);
	}
	
	return (0);
}