#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long //因数分解 map prime_factor(int n){ map mp; //{約数,個数} for(int i = 2; i*i <= n; i++){ while(n%i == 0){ mp[i]++; n /= i; } } if(n != 1) mp[n] = 1; //n=素数 return mp; } signed main(){ int n; cin >> n; auto mp = prime_factor(n); for(auto p : mp){ if(p.first <= 2) continue; cout << p.first; return 0; } return 0; }