#include const long mod = 1000000007; int main() { long N; std::cin >> N; for(long m = 3; m < sqrt(N) + 100; ++m) { if( N % m == 0 ) { std::cout << m << std::endl; return 0; } } std::cout << N << std::endl; return 0; }