#include #include #include #include #include #include #include #include #define ll long long int main() { ll N; std::cin >> N; ll ss = sqrt(N); ll ans = -1; for(int i = 3; i <= ss; i++) { if(N % i == 0) { ans = i; break; } } if(ans == -1) { ans = N; } std::cout << ans << std::endl; }