program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: l,r,i,j,md

    read*, l,r
    if (r-l+1 >= 2019) then
        print'(i0)', 0
        stop
    end if
    
    if (mod(l,2019) <= mod(r,2019)) then
        print*, mod(l,2019)*(mod(l,2019)+1)
    else
        print*,0
    end if
end program name