using System; using System.Linq; using System.Collections; using System.Collections.Generic; public class P{ public static void Main(){ int n = InputToInt(); int[] m = Input().Split().MapInt(); for(int i=n; i>0; --i){if(m[i-1]==n){--n;}} Print(n); } public static void Print(params object[] o){ for(int i=0; i