#include #include using namespace std; typedef unsigned long long uint64; int main() { uint64 n; uint64 i; cin >> n; i = 3; while ((i*i) <= n) { if ((n%i)==0) { cout << i << endl; return 0; } i++; } if ((n%2)==0) { cout << n/2 << endl; } else { cout << n << endl; } return 0; }