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