import scala.io.{StdIn => in}

object Main extends App {
  val mod = 2019
  val Array(l, r) = in.readLine.split(" ").map(_.toLong)

  val res = for(i <- 1 until mod if l + i <= r) yield {
    (l % mod) * ((l+i) % mod) 
  }

  val ans = res.min
  println(ans)
}