#include using namespace std; using ll = long long; int main() { ll n; cin >> n; for (int i = 3; i <= sqrt(n); ++i) { if (!(n % i)) { cout << i << endl; return 0; } } cout << n << endl; }