#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const long long mod = 1000 * 1000 * 1000 + 7;
const long long inf = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
const long long mod2 = 998244353;
const long long N = 5000 * 100 + 10;
const long long NN = 1000 * 100 + 100;
long long power(long long x, long long y, long long p = LLONG_MAX) {
  long long res = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void IO() {}
long long solve(long long n) {
  long long ans = n, ans2 = 0, i = 1;
  while (n > 0) {
    ans2 += (i * (9 - n % 10));
    i *= 10;
    n /= 10;
  }
  return 1LL * ans * ans2;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long l, r, mx = 0;
    cin >> l >> r;
    long long nd = 0, r2 = r;
    while (r2 > 0) {
      r2 /= 10;
      nd++;
    }
    long long z = power(10, nd) / 2;
    long long ans = min(max(l, z), r);
    cout << solve(ans) << "\n";
  }
  return 0;
}
