#include #include #include #include #include using namespace std; int main() { int n; cin >> n; long long result = 0; for(int i=0; i d; d.push_back(1); long long a; cin >> a; for(long long x=2; x*x<=a; ++x) { while(a % x == 0) { d.push_back(x); a /= x; } } if(a != 1) d.push_back(a); for(auto i=d.rbegin(); i!=d.rend(); ++i) { long long x = *i; r += p; p *= x; } result += r; } cout << result << endl; return 0; }