import java.util.*; import java.io.*; class prob365 { public static void main(String args[])throws IOException { BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(sc.readLine()); String s[]=sc.readLine().split(" "); int a[]=new int[n]; for(int i=0;i=0;i--) { if(target==a[i]) { ans--; target--; } } System.out.println(ans); } }