#include
using namespace std;
int binary(int arr[], int key, int start, int last)
{
int mid= (last-start)/2;
if(key==arr[mid]) return mid;
else if(key<arr[mid])
return binary(arr, key, start, mid-1);
else if(key>arr[mid])
return binary(arr, key, mid+1, last);
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;
cout<< binary(arr,key,0,n-1);
}
//This is the code. Pls Help