#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long N6 = 1005000;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  long long p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      long long g = gcd(p, k);
      p /= g;
      k /= g;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b) * b); }
long long max(long long a, long long b) {
  long long ans = a > b ? a : b;
  return ans;
}
long long min(long long a, long long b) {
  long long ans = a < b ? a : b;
  return ans;
}
clock_t time_p = clock();
void rtime() {
  time_p = clock() - time_p;
  cerr << "******************\nTime taken : "
       << (double)(time_p) / CLOCKS_PER_SEC << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  {
    long long l, r;
    cin >> l >> r;
    long long x = 1, y = r, c = 0;
    while (y) {
      y /= 10;
      x *= 10;
    }
    y = (x - 1) / 2;
    if ((y >= l && y <= r) || (y + 1 >= l && y + 1 <= r))
      c = y * (y + 1);
    else if (y < l)
      c = l * (x - 1 - l);
    else if (y > r)
      c = r * (x - 1 - r);
    cout << c << "\n";
  }
  rtime();
  return 0;
}
