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