#include #include #include #include #include using namespace std; #define INF 2000000007 #define MOD 1000003 #define MAX 105 #define REP(i,n) for(int i=0;i<(n);++i) #define REPS(i,s,t) for(int i=(s);i<(t);++i) typedef unsigned int uint; typedef unsigned long long int ull; vector prime(int N){ int cnt = 1; vector pn(N+1); REPS(i,N,1) pn[i]=i; for(int i=4;i p(cnt); for(int i=0,j=2;j &array,int num){ for(int i=0;i>N; vector a(N+2); REPS(i,1,N+1) cin>>a[i]; int cnt=N; for(int i=N;i>0;--i){ if(a[i]==cnt)--cnt; } cout << cnt << endl; return 0; }