#include #include #include #include #include #include #include #include #include #include #include #include //#include "toollib.h" #define INT_MAX 2147483647 #define Loop(i, n) for(int i = 0; i < (int)n; i++) #pragma warning (disable:4018) using namespace std; typedef long long int lint; //***** Main Program ***** int main() { lint n; cin >> n; if (n % 3 == 0) cout << 3 << endl; else if (n % 4 == 0) cout << 4 << endl; else { bool judge = true; for (lint i = 5; i <= sqrt(n); i = i + 2) { if (n%i == 0) { cout << i << endl; judge = false; break; } } if (judge) { if (n % 2 == 0) cout << n / 2 << endl; else cout << n << endl; } } return 0; }