#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int a, b, i, p;
  cin >> a >> b;
  if (b < a) swap(a, b);
  int ar[] = {2, 3, 5, 7, 11};
  vector<long long> v;
  for (i = 0; i < 5; i++) {
    p = ar[i];
    int c = 0, f, d = 0;
    f = p;
    while (f <= a) {
      c = c + a / f;
      f = f * p;
    }
    f = p;
    while (f <= b) {
      d = d + b / f;
      f = f * p;
    }
    v.push_back(min(c, d));
  }
  long long ans = 1;
  for (i = 0; i < 5; i++) {
    ans = ans * pow(ar[i], v[i]);
  }
  cout << ans << endl;
  return 0;
}
