require 'pp'
require 'set'

l,r = gets.chomp!.split(" ").map(&:to_i)

next_2019 = (l / 2019 + 1) * 2019

if next_2019 <= r
    puts 0
else
    min = l % 2019
    max = r % 2019

    puts min * (min + 1)
end
