import java.util.Scanner object no481{ def main(args:Array[String]):Unit={ val scan = new Scanner(System.in) var tmp:Int = 1 for(i <- 1 to 9){ val get = scan.nextInt if( get - tmp == 2 || (i == 1 && get == 2)){ println(get - 1) return } tmp = get } println(10) } }