#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int main() {
  long long a, b;
  cin >> a >> b;
  long long low = 0, ans = 0;
  while (low < a) low = low * 10 + 9;
  ans = a * (low - a);
  while (low / 2 <= b) {
    long long p = max(a, max(low / 2, low / 2 + 1));
    ans = max(ans, p * (low - p));
    low = low * 10 + 9;
  }
  if (b * 10 <= low)
    ans = max(ans, b * (low / 10 - b));
  else
    ans = max(ans, b * (low - b));
  cout << ans << endl;
  return 0;
}
