L, R = gets.chomp.split.map(&:to_i)

l = L % 2019
r = R % 2019

mods = []
L.upto(R).each do |i|
  mod = i % 2019
  mods << mod
end

# p [L, R]
# p mods

mods.sort!
# p mods[0]
# p mods[1]

p mods[0] * mods[1]