#include #include #include #include #include #include #include using namespace std; typedef long long ll; ll f(ll n) { ll ret = n; for(ll i = 3; i * i <= n; i++) { if(n % i == 0) { ret = min(ret, i); ret = min(ret, n / i); } } return ret; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; cout << f(N) << endl; }