a, b = [ int(v) for v in input().split() ] print(a ^ b)