#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, r;
  cin >> l >> r;
  long long ml = 1;
  for (int i = l; i > 0; i /= 10) ml *= 10;
  ml /= 2;
  long long mr = 1;
  for (int i = r; i > 0; i /= 10) mr *= 10;
  mr /= 2;
  long long k;
  if (ml == mr) {
    if (r <= mr)
      k = r;
    else if (l >= mr)
      k = l;
    else
      k = mr;
  } else
    k = min((long long)r, mr);
  cout << k * (2 * mr - 1 - k);
}
