#include <stdio.h>
#include <stdint.h>
int binary_search(uint8_t *arr, uint8_t n, uint8_t key) {
uint8_t h, l , m, val;
if(n == 0) return -1;
h = n-1;
l = 0;
while(l <= h){
m = l + (h-l)/2;
val = arr[m];
if(val == key){
return m;
}
else if(val < key){
l = m+1;
}
else {
h = m-1;
}
}
return -1;
}
int main() {
uint8_t n, key;
scanf("%hhu", &n);
uint8_t arr[100];
for (uint8_t i = 0; i < n; i++) {
scanf("%hhu", &arr[i]);
}
scanf("%hhu", &key);
int index = binary_search(arr, n, key);
printf("%d", index);
return 0;
}