#include #include using namespace std; using lint=int64_t; int main() { lint N; cin >> N; for(lint i=3;i*i<=N;i++) { if(N%i==0) { cout << i << endl; return 0; } } if(N%2==0) cout << N/2; else cout << N; cout << endl; return 0; }