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