#include using namespace std; int main() { int n, k; cin >> n >> k; map mp; for (int i = 2, j = n; j != 1; i++) { while (j % i == 0) { mp[i]++; j /= i; } } int num = 0, ans = 0; for (int i = 2; i < n; i++) { map tmp; for (int j = 2, k = i; k != 1; j++) { while (k % j == 0) { tmp[j]++; k /= j; } } int puni = 0; for (auto &p : mp) { puni += min(p.second, tmp[p.first]); } if (num < puni) { num = puni; ans = i; } } cout << ans << endl; return 0; }