#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-8
#define rep(i,j) for(int  i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = j; i < k; i++)
typedef long long ll;
typedef pair<int,int> Pii;
int main(){
        int n;
        scanf("%d",&n);
        int num[128];
        rep(i,n){
                scanf("%d",&num[i]);
        }
        int target;
        scanf("%d",&target);
        int l = 0;
        int r = n-1;
        int mid = (l+r)/2;
        int cnt = 1;
        while(num[mid] != target && mid > 0 && mid < n-1){
                cnt++;
                if(num[mid] > target)r = mid;
                else l = mid+1;
                mid = (l+r)/2;
        }
        printf("%d\n",cnt);
        return 0;
}