import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = 1; for ( ; i <= 9; i++) { int n = sc.nextInt(); if (n == i) { continue; } else { System.out.println(i); break; } } if (i == 10) { System.out.println(10); } sc.close(); } }