#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" #define rep(i,n) for(int i = 0;i < n;i++) #define REP(i,n,k) for(int i = n;i < k;i++) #define P(p) cout<<(p)<> ret; return ret; } bool isPrime(ll n){ if (n % 2 == 0)return false; for (ll i = 3; i*i <= n; i += 2){ if (n%i == 0)return false; } return true; } void solve() { ll n; cin >> n; ll mini = n; for (ll i = 2; i*i <= n; i++){ if (n % i == 0){ mini = min(mini, i); mini = n / i > 2 ? min(mini, n / i) : mini; } } P(mini) } int main() { solve(); return 0; }