#include using namespace std; #define ll long long ll a; ll s = 1; int main() { cin >> a; ll n = a; s += a; for(int i = 2; i * i <= a; i++) { ll c = 0; while(a % i == 0) { a /= i; c++; } s += (c * i); } if(a > 1 && a != n) { s += a; } cout << s; return 0; }