import sys def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): Bs = set([int(i) for i in input().split()]) ans = set(range(1, 10)) - Bs print(ans.pop()) if __name__ == '__main__': solve()