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