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