#include using namespace std; using ll = long long; ll f(ll a) { return a * a; } int main() { ll n; cin >> n; for (int i = 3; f(i) <= n; ++i) { if (!(n % i)) { cout << i << endl; return 0; } } cout << n << endl; }