#include #include using namespace std; uint64_t func(uint64_t n) { if (n % 3 == 0) { return 3; } if (n % 4 == 0) { return 4; } if (n % 2 == 0) { n /= 2; } for (uint64_t i = 5; i * i <= n; i += 2) { if (n % i == 0) { return i; } } return n; } int main() { ios::sync_with_stdio(false); cin.tie(0); uint64_t n; cin >> n; cout << func(n) << endl; return 0; }