print(6 - sum([int(i) for i in input().split()]))