import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000581_Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String[] t = br.readLine().split(" "); String a = Long.toBinaryString(Long.parseLong(t[0])); String c = Long.toBinaryString(Long.parseLong(t[1])); int len = Math.max(a.length(), c.length()); a = String.format("%" + len + "s", a).replaceAll(" ", "0"); c = String.format("%" + len + "s", c).replaceAll(" ", "0"); char[] b = new char[len]; for(int i = 0; i < a.length(); i++) { if(a.charAt(i) == c.charAt(i)) { b[i] = '0'; } else { b[i] = '1'; } } System.out.println(Long.parseLong(new String(b), 2)); } }