#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
template <class T>
T gcd(T a, T b) {
  for (T c; b; c = a, a = b, b = c % b)
    ;
  return a;
}
template <class T>
void out(const vector<T> &a) {
  for (int i = 0; i < ((int)(a).size()); ++i) cout << a[i] << " ";
  cout << endl;
}
int countbit(int n) { return n == 0 ? 0 : 1 + countbit(n & (n - 1)); }
const int d8[8][2] = {{1, 0}, {-1, 0},  {0, 1},  {0, -1},
                      {1, 1}, {-1, -1}, {1, -1}, {-1, 1}};
const int d4[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
inline int dcmp(double x) { return (x > EPS) - (x < -EPS); }
inline double cross(const complex<double> &a, const complex<double> &b) {
  return (conj(a) * b).imag();
}
inline double dot(const complex<double> &a, const complex<double> &b) {
  return (conj(a) * b).real();
}
long long ten[16];
int main() {
  long long A, B;
  cin >> A >> B;
  ten[0] = 1;
  for (int i = 1; i < 16; ++i) ten[i] = ten[i - 1] * 10;
  long long ret = 0;
  for (int i = 1; i < 16 && B >= ten[i] / 10; ++i) {
    long long C = min(ten[i] - 1, B);
    if (A > C) continue;
    ret = max(ret, (ten[i] - 1 - A) * A);
    ret = max(ret, (ten[i] - 1 - C) * C);
    long long mid = (ten[i] - 1) / 2;
    if (mid >= A && mid <= C) ret = max(ret, (ten[i] - 1 - mid) * mid);
    A = C + 1;
  }
  cout << ret << endl;
  return 0;
}
