#! usr/bin/env python3 A,C = map(int,input().split(" ")) print(C ^ A)