A, C = [int(i) for i in input().split(' ')] print(A ^ C)