#include using namespace std; vector div(long n) { vector v; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { v.push_back(i); if (i * i != n) v.push_back(n / i); } } sort(begin(v), end(v)); return v; } int main() { long N; cin >> N; vector V = div(N); for (auto a : V) if (a > 2) return cout << a << "\n", 0; }