#include <stdio.h>

int main()
{
        int n, i, start, end;
        int data[100];
        int search;
        int count;
        int center;
     while (scanf("%d", &n) && n != 0) {
                for (i = 0; i < n; i++) {
                        scanf("%d", &data[i]);
                }
                scanf("%d", &search);
                start = 0;
                end = n-1;
                count = 0;
                while (start <= end) {
                  center = (start+end)/2;
                  count++;
                  if (search > data[center]) {
                    start = center+1;
                  }  else if (search < data[center]){
                    end = center-1;
                  } else if (search == data[center])
                         break;
                }
                printf("%d\n", count);
        }
        return 0;
}