import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) b = list(map(int, read().split())) for i in range(1, 10): if i != b[i - 1]: print(i) exit() print(10)