a, b = gets.split.map(&:to_i)
ans=['','']
[a-1, b].each_with_index do |n,i|
  n.bit_length.times do |j|
    bit = 0
    if j ==0
      mod = n % 2**(2)
      bit = (mod==2||mod==1) ? 1 : 0
    else
      mod = n % 2**(j+1)
      bit =
        if mod<2**(j)
          0
        else
          cnt = mod-2**(j)+1
          cnt%2
        end
    end
    ans[i] = bit.to_s + ans[i]
  end
end
#puts ans.to_s
puts ans[0].to_i(2)^ans[1].to_i(2)