var Main = input => {
    input = input.split("\n");
    tmp1 = input[0].split(" ");
    var L = parseInt(tmp1[0], 10);
    var R = parseInt(tmp1[1], 10);
    var result = L * R % 2019;
    console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
