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