fun main(args: Array<String>) {
    val (a,b) = readLine()!!.split(" ").mapIndexed{ s ,i-> s.toLong()+i.toLong()-1 }.map{num->Array(62){2.toLong() shl it}.map{i-> ((num-num%i)/2 + Math.max(num%i+1-i/2,0))%2 } }
    println((0 until 62).map { if(a[it] != b[it]){ 1.toLong() shl it}else 0 }.sum())
}