s = set(map(int, raw_input().split())) print list(set(range(10) - s))[0]