A,B=gets.split.map &:to_i
x=0;
def getnum(a,i)
    flr=(a+1)/(2**(i+1))*2**(i+1)-1
    c=a-flr-2**i
    if c<0 then c=0 end
    c+=(flr+1)/2
    return c
end
50.times{|i|
    b=getnum(B,i)
    a=getnum(A-1,i)
    if (b-a)[0]==1 then x+=2**i end
}
p x