#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> p_fact(int N){ vector> res; for(int p=2; p*p<=N; ++p){ if(N % p != 0) continue; int ex = 0; while(N % p == 0){ N /= p; ex++; } res.push_back({p,ex}); } if(N != 1) res.push_back({N,1}); return res; } int main(){ int N; cin >> N; int ans = 0; if(N == 1){ cout << ans << endl; return 0; } auto pf = p_fact(N); for(auto &[p,ex] : pf){ rep(i, 0, ex) ans += p; } cout << ans << endl; return 0; }