#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, k = 1;
  scanf("%I64d%I64d", &a, &b);
  long long q = 10;
  while (q <= b) {
    q *= 10;
    k++;
  }
  q /= 10;
  k--;
  long long i, t = q * 10;
  long long w = (b - (t - b - 1)), r;
  if (w < 0) w *= -1;
  if (a < t / 2 && b > t / 2)
    i = t / 2 - 1;
  else if (b < t / 2)
    for (i = b - 1; i >= a; i--) {
      if (i < q) break;
      r = (i - (t - i - 1));
      if (r < 0) r *= -1;
      if (r >= w)
        break;
      else
        w = r;
    }
  else {
    w = (a - (t - a - 1));
    for (i = a + 1; i <= b; i++) {
      if (i < q) break;
      r = (i - (t - i - 1));
      if (r < 0) r *= -1;
      if (r >= w)
        break;
      else
        w = r;
    }
    i -= 2;
  }
  r = (i + 1) * (t - i - 2);
  if (r < 0) r *= -1;
  printf("%I64d", r);
  return 0;
}
