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