#include #include using namespace std; using LL = long long; using P = pair; using Graph = vector>; const long long LINF = 1LL << 60; #define all(x) (x).begin(), (x).end() #define rep(i,n) for(int i = 0; i < (n); ++i) templatevoid chmin(T&a, T b){if(a > b) a = b;} templatevoid chmax(T&a, T b){if(a < b) a = b;} vector> prime_factorize(LL N){ vector> res; for(LL a = 2; a*a <= N; ++a){ if(N%a != 0) continue; LL ex = 0; while(N%a==0){ ++ex; N /= a; } res.push_back({a, ex}); } if(N != 1) res.push_back({N, 1}); return res; } int main(){ //入力 LL N; cin >> N; const auto &pf = prime_factorize(N); LL res = 0; for(auto p : pf) res += p.first * p.second; cout << res << endl; }