l = map(int, raw_input().split(' ')) for i in range(1, 10): if i != l[i - 1]: print(str(i)) quit() print('10')