#include #include #include using namespace std; #define RREP(i,s,e) for (i = e-1; i >= s; i--) #define rrep(i,n) RREP(i,0,n) #define REP(i,s,e) for (i = s; i < e; i++) #define rep(i,n) REP(i,0,n) #define INF 1e8 typedef long long ll; int main() { ll ans, n; cin >> n; REP (ans,3,sqrt(n)+1) { if (n % ans == 0) { cout << ans << endl; return 0; } } if (n % 2 == 0 && n / 2 != 2) cout << n / 2 << endl; else cout << n << endl; return 0; }