#include
int bsearch(int [],int,int);
using namespace std;
int main()
{
int n,num,index;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
cin>>num;
index=bsearch(a,n,num);
if(index==-1){
}
else{
cout<<index;
}
return 0;
}
int bsearch(int a[],int n,int ele){
int beg=0;
int last=n-1;
while(beg<=last){
int mid=(beg+last)/2;
if(ele==a[mid]){
return mid;
}
else if(ele>a[mid]){
beg=mid+1;
}
else {last =n-1;}
}
return -1;
}