#include <bits/stdc++.h>
using namespace std;
int arr[2000000];
int n ;
// returns the index at which x is present in the arr
// if not returns -1
int binarySearch(int l, int r , int x){
	if(l>r)return -1;
	
	else {
		int mid =(l+r)/2;
		if(arr[mid]==x){
			return mid;
		}
		else if(arr[mid]>x){
			return binarySearch(l,mid-1, x);
		}
		else {
			return binarySearch(mid+1, r, x);
		}
	}
}
int main(){
	// the length of the array
	
	cin>>n;
	for(int i=0; i<n; i++){
		cin>>arr[i];
	}
	// if the array was not sorted before
	sort(arr, arr+n);
	
	// input the element to be searched
	int x;
	cin>>x;
	
	cout<<"x is present at the index "<<binarySearch(0,n-1, x)<<endl;
	
}
