#include #include #include long long f(long long N) { std::vector prim; for (long long n = 3; n < (N / n); n++) { for (long long m = 0; m < prim.size(); m++) { if ((n % prim[m]) == 0) goto is_prim; } if ((N % n) == 0) return n; prim.push_back(n); is_prim: ; } return N; } int main() { long long N; std::cin >> N; std::cout << f(N) << std::endl; return 0; }