#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  long long bint = stoi(b);
  long long aint = stoi(a);
  int len_a = a.length();
  int len_b = b.length();
  long long x = (long long)(pow(10, len_b));
  if (bint >= ((x / 2) - 1) && aint <= ((x / 2)))
    cout << (x / 2) * ((x - 1) - (x / 2));
  else
    cout << max(bint * (x - 1 - bint), aint * (x - 1 - aint));
  return 0;
}
