#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) #define FOR(i,a,b) for(ll i = (a);i<(b);i++) #define REP(i,a) FOR(i,0,(a)) #define MP make_pair ll getAns(ll n){ for(ll i = 3;i * i <= n;i++){ if(n % i == 0) return i; } if(n % 2 == 0) return n / 2; return n; } int main() { ll n; cin >> n; cout << getAns(n) << endl; return 0; }