program abc121_d
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: a,b,i,ans,d

    read*, a,b
    i=2
    ans=0
    d = b-a+1
    do while(i/2 <= b)
        if(btest(count_m(b,i)-count_m(a-1,i),0)) ans=ans+i/2
        i=i*2
    end do
    print'(i0)', ans
contains
    function count_m(x,b) result(ret)
        integer(int64):: x,b,hb,ret
        hb = b/2
        ret = hb*(x/b) + max(mod(x,b)-(hb-1),0_8)
    end function
end program abc121_d