#include <cstdio>
#include <algorithm>
using namespace std;


int main(){
    int n, arr[100], key;
    while(scanf("%d", &n) != EOF && n){
        for(int x = 0; x < n; x++){
            scanf("%d", &arr[x]);
        }
        scanf("%d", &key);
        int left = 0, right = n-1, mid, count = 0;
        while(left <= right){
            count++;
            mid = (left + right) / 2;
            if(arr[mid] == key) break;
            if(arr[mid] < key) left = mid + 1;
            if(arr[mid] > key) right = mid - 1;
        }
        printf("%d\n", count);
    }
    return 0;
}