#include<iostream>
using namespace std;
#define NIL 1000;
void main()
{ int BinarySearch(int *A,int begin,int end ,int elem);
int A[8]={1,3,5,7,8,10,12,14};
int index=BinarySearch(A,0,7,6);
cout<<index<<endl;
char f;
cin>>f;
}
int BinarySearch(int *A,int begin,int end ,int elem)
{
int l=begin;
int h=end;
while(h-l>1)
{ int mid=(l+h)/2;
if(elem==A[mid])
{
return mid;
}
else
{
if(elem>A[mid])
l=mid;
else
h=mid;
}
}
return NIL;
}