#include <bits/stdc++.h>
using namespace std;
unsigned long long answer, p, q;
int L, R, la, lb, maxi, mini;
int localmax[] = {0,     9,      99,      999,      9999,
                  99999, 999999, 9999999, 99999999, 999999999};
void deal(int d) {
  int i, j, m, n;
  m = localmax[d] / 2;
  if (mini > m) {
    p = (localmax[d] - mini);
    q = mini;
  } else if (maxi < m) {
    p = (localmax[d] - maxi);
    q = maxi;
  } else {
    p = (localmax[d] - m);
    q = m;
  }
  answer = p * q;
}
int main(void) {
  int i, j, m, flag = -1, l;
  char A[20], B[20];
  scanf("%s", A);
  la = strlen(A);
  scanf("%s", B);
  lb = strlen(B);
  if (atoi(B) == 1000000000)
    cout << "8999999999000000000\n";
  else {
    if (lb > la) {
      mini = 0;
      maxi = atoi(B);
    } else if (lb == la) {
      mini = atoi(A);
      maxi = atoi(B);
    }
    deal(lb);
    cout << answer << endl;
  }
  return 0;
}
