package yukikoda; import java.util.Scanner; public class no481 { public static void main(String[] args) { int[] num = new int[9]; int number = 10; Scanner sc = new Scanner(System.in); for(int i=0; i<9; i++) { num[i] = sc.nextInt(); } for(int j=1; j<=9; j++) { if(num[j-1] != j) { number = j; break; } } System.out.println(number); } }