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