a,b = gets.split.map(&:to_i)

chk = 4
ans = ((b+1)/2 - a/2) %2
40.times do
  x = (a-1)%chk
  y = b%chk
  x = x >= chk/2 ? x-(chk/2-1) : 0
  y = y >= chk/2 ? y-(chk/2-1) : 0
  ans += ((y-x) % 2 )*(chk/2)
  chk *= 2
end
p ans
