#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  os << '{';
  for (int i = (0), __i = (((int)(vec).size())); i < __i; i++) {
    os << vec[i];
    if (i + 1 != ((int)(vec).size())) os << ',';
  }
  os << '}';
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &par) {
  os << '(' << par.first << ',' << par.second << ')';
  return os;
}
long long f(int n) {
  long long p10 = 1;
  while (p10 <= n) {
    p10 *= 10;
  }
  return n * (p10 - n - 1);
}
int main() {
  int a, b;
  cin >> a >> b;
  int p10 = 1;
  long long ans = max(f(a), f(b));
  for (int i = (0), __i = (9); i < __i; i++) {
    p10 *= 10;
    int t = (p10 - 1) / 2;
    if (a <= t && t <= b) ans = max(ans, f(t));
  }
  cout << ans << endl;
  return 0;
}
