import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array,
  std.functional, std.container, std.typecons;

void main() {
  auto input = readln.split.to!(ulong[]);
  ulong L = input[0], R = input[1];
  int ans = 0;
  if((R % 2019 - L % 2019) == (R-L)) {
    int a = L % 2019;
    ans = a * (a+1);
  } else {
    ans = 0;
  }
  ans.writeln;
}
