#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long l, r;
long long g(long long x) {
  long long t = 1;
  while (t <= x) t *= 10;
  return (t - 1 - x) * x;
}
int main() {
  cin >> l >> r;
  long long res = max(g(l), g(r));
  long long t = 5;
  for (int i = 0, _n = (9); i < _n; i++) {
    if (l <= t && t <= r) res = max(res, g(t));
    t *= 10;
  }
  cout << res << endl;
  return 0;
}
