#include
using namespace std;
int search(int arr,int n,int key){
int start=0;
int end=n-1;
int middle=(start+end)/2;
while(start<end){
if(arr[middle]==key) return middle;
else if(arr[middle]<key){
start=middle;
}
else{
end=middle;
}
}
return -1;
}
int main() {
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int key;
cin>>key;
search(arr[n],n,key);
return 0;
}