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