#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int s[10000];
	int n,a=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>s[i];
	}
	
	
	
	
	int t;
	cin>>t;
	int left=0,right=n-1;
	while(left<=right)
	{
		++a;
		int mid=(left+right)/2;
		if(s[mid]>t)
		{
			right=mid-1;
		}
		else if(s[mid]<t)
		{
			left=mid+1;
		}
		else
		{
			cout<<mid<<endl;
			cout<<a;
			break;
		}
		
		
	}
	if(left>right)
	{
		cout<<"no"<<endl;
		cout<<a;
	}
	
	return 0;
}
