solve [a, b] = sum [ mod (f i) 2 * 2^i | i <- [0..40] ] where
  f i = cnt (b+1) - cnt a where
    cnt x = q * 2^i + max 0 (r - 2^i)
      where (q, r) = divMod x (2^(i+1))

main = getLine >>= print . solve . map read . words