#include #include using namespace std; using LL = long long; using P = pair; using Graph = vector>; const int INF = 1 << 29; 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(long long N){ vector> res; for(long long a = 2; a * a <= N; ++a){ if(N%a != 0) continue; long long 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(){ //input int N; cin >> N; if(N == 1){ cout << 0 << endl; return 0; } else{ long long ans = 0; const auto &res = prime_factorize(N); for(auto p : res){ ans += p.first * p.second; } cout << ans << endl; } }