#include <bits/stdc++.h>
using namespace std;
long long on[] = {1LL,         10LL,         100LL,        1000LL,
                  10000LL,     100000LL,     1000000LL,    10000000LL,
                  100000000LL, 1000000000LL, 10000000000LL};
int bassay(long long x) {
  int s = 0;
  while (x) {
    x /= 10;
    s++;
  }
  return s;
}
int main() {
  long long x, y, a;
  int xb, yb;
  cin >> x >> y;
  xb = bassay(x);
  yb = bassay(y);
  if (xb == yb) {
    a = on[xb] / 2;
    if (a < x) {
      cout << (on[xb] - 1 - x) * x << endl;
    } else if (y < a - 1) {
      cout << (on[yb] - 1 - y) * y << endl;
    } else {
      cout << a * (a - 1) << endl;
    }
  } else {
    a = on[yb] / 2;
    if (y >= a - 1) {
      cout << a * (a - 1) << endl;
    } else {
      cout << y * (on[yb] - y - 1) << endl;
    }
  }
  return 0;
}
