Input = input().split() taget_num = 1 for i in Input: if (int(i) != taget_num): break taget_num += 1 print(taget_num)