#include <bits/stdc++.h>
using namespace std;
map<long long, long long> f;
long long F(long long numb) {
  long long buff = numb, m = 0;
  while (buff) {
    buff /= 10;
    m = m * 10 + 9;
  }
  return numb * (m - numb);
}
void CalcExtramsOfFunctions() {
  long long numb = 0;
  for (int digit_count = 0; digit_count < 10; ++digit_count) {
    numb = numb * 10 + 9;
    long long first = numb / 2, second = first + 1;
    f[first] = first * (numb - first);
    f[second] = second * (numb - second);
  }
}
int main() {
  int l, r;
  cin >> l >> r;
  f[l] = F(l);
  f[r] = F(r);
  CalcExtramsOfFunctions();
  long long res = -1;
  for (map<long long, long long>::iterator it = f.begin(); it != f.end();
       ++it) {
    if (l <= it->first && it->first <= r) {
      res = max(res, it->second);
    }
  }
  cout << res;
  return 0;
}
