#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; vector divisor(ll n){ vector ret; for(ll i=1; i*i<=n; i++){ if(n%i==0){ ret.push_back(i); if(i!=n/i) ret.push_back(n/i); } } sort(ret.begin(), ret.end()); return ret; } int main(){ ll N; cin >> N; vector div = divisor(N); rep(i,div.size()){ if(div[i] == 1 || div[i] == 2) continue; cout << div[i] << endl; break; } return 0; }