#include<iostream>
#include<cstdio>
using namespace std;
const int maxn=1e6+10;
int a[maxn],n,k;void solve(){//初始化解的存在范围int lb=-1,ub=n; //(lb,ub]//重复循环,直到解的存在范围不大于1while(ub-lb>1){int mid=(lb+ub)/2;if(a[mid]>=k){//如果mid满足条件,则解的存在范围变为(lb,mid]ub=mid;}else{//如果mid不满足条件,则解的存在范围变为(mid,ub]lb=mid;}}//这时,lb+1=ubprintf("%d\n",ub);
}int main()
{scanf("%d",&n);for(int i=0;i<n;i++)scanf("%d",&a[i]);scanf("%d",&k);solve();return 0;
}
/*
5
2 3 3 5 6
3
*/