#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; i++) #define all(a) (a).begin(), (a).end() vector enum_divisors(ll n) { vector res; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { res.push_back(i); if (n / i != i) res.push_back(n / i); } } sort(res.begin(), res.end()); return res; } int main() { cin.tie(nullptr); ll N; cin >> N; vector divs = enum_divisors(N); int i = 0; while (true) { if (divs[i] >= 3) { cout << divs[i] << '\n'; return 0; } i++; } }