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(); int c = 0; int ans = 0; for(int i=n; i>0; --i){ if(m[i-1] == n){ ans += c; c = 0; --n; }else{ ++c; } } Print(ans); } public static void Print(params object[] o){ for(int i=0; i