#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
template <typename T>
istream& operator>>(istream& in, vector<T>& v) {
  for (int i = 0; i < v.size(); i++) {
    in >> v[i];
  }
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> v) {
  for (int i = 0; i < v.size(); i++) {
    out << v[i] << ' ';
  }
  return out;
}
int cnt(long long a) {
  int res = 0;
  while (a) {
    res++;
    a /= 10;
  }
  return res;
}
long long pow(long long a, long long b) {
  long long res = 1;
  while (b--) {
    res *= a;
  }
  return res;
}
void solve() {
  long long l, r;
  cin >> l >> r;
  int cntl = cnt(l);
  int cntr = cnt(r);
  long long ans = 0;
  for (int i = cntl; i <= cntr; i++) {
    long long a = pow(10, i);
    long long mid = (a - 1) / 2;
    mid = min(r, max(l, mid));
    ans = max((a - 1 - mid) * mid, ans);
    mid = a / 2;
    mid = min(r, max(l, mid));
    ans = max((a - 1 - mid) * mid, ans);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
