#include #include using namespace std; int main() { long long n; cin >> n; long long ans = n; long long limit = 1e7; for (long long i = 3; i <= limit; i++) { if (n % i == 0) { ans = i; break; } } cout << ans << endl; return 0; }