object Main extends App {
  import scala.io.StdIn._

  val Array(a, b) = readLine.trim.split(' ').map(_.toLong)
  println(
    (0 until 63).filter(d ⇒ countUntil(a, 1L << d) % 2  != countUntil(b + 1, 1L << d) % 2).map(1L << _).sum
  )
  def countUntil(x: Long, digit: Long): Long = {//digit == 1 << d
    if (x < digit) 0
    else {
      //0 until x のうち、1 << d　が1である物の数
      val h = x / (digit * 2) * digit
      if (x / digit % 2 == 0) {
        h
      }else {
        h + (x % digit)
      }
    }
  }
}