#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
const int tmp = 2019;
int main() {
  long long l, r;
  cin >> l >> r;
  if (l / tmp == r / tmp) {
    int m = l / tmp;
    int t = l - m * tmp;
    cout << t * (t + 1) << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
