#include
using namespace std;
int BinaryRecursion(int A[],int start,int end,int key)
{
if (end>=1)
{
int mid=(start+end)/2;
if (A[mid]==key)
{
return mid;
}
if (A[mid]>key)
{
return BinaryRecursion(A,start,mid-1,key);
}
else
{
return BinaryRecursion(A,mid+1,end,key);
}
}
return -1;
}
int main()
{
int num;
cin>>num;
int Array[num];
for (int i = 0; i < num; i++)
{
cin>>Array[i];
}
int key;
cin>>key;
int start=0;
cout<<BinaryRecursion(Array,start,num-1,key);
return 0;
}