num_l = list(map(int, input().split())) for i in num_l: if i == 9: print(10) if i != num_l.index(i) + 1: print(i-1) break