import java.util.Scanner; public class Test15 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String ss = sc.nextLine(); String[]s =ss.split(" "); int c=1; for(int i=1;i<=10;i++){ int a = Integer.parseInt(s[i-1]); if(a!=c){ System.out.println(a-1); break; } c++; } } }