#include<bits/stdc++.h>
using namespace std;
int x,a[10000]={0},l,r,mid;
int main(){
cin>>x;
for(int i=1;i<=1500;i++)
cin>>a[i];
l=1;r=1500;
while(l<=r){
mid=(l+r)/2;
if(a[mid]==x){cout<<mid;return 0;}
if(x<a[mid])r=mid-1;
else l=mid+1;
}
cout<<-1;
return 0;
}