#include #define IOS std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); #define forn(i, n) for(int i = 0; i < int(n); ++i) #define forin(i, n) for(int i = n-1; i >= 0; --i) #define forab(i, a, b) for(int i = a; i < int(b); ++i) #define sz(x) ((ll) (x).size()) #define all(x) (x).begin(), (x).end() #define PI 2*acos(0.0) #define LSOne(S) (S & (-S)) using namespace std; typedef long long ll; typedef vector vi; typedef pair ii; typedef vector vii; vector primes; ll divi[1000000]; void criba(ll lim) { bitset<3000000> bs; bs.reset(); for(ll i = 2; i < lim; i++) { if(bs[i]) continue; primes.push_back(i); for(ll k = i * i; k < lim; k+=i) bs[i] = 1; } } int getpr(ll num) { int n = 0; vector ans; for(auto pr : primes) { while(num % pr == 0) { divi[n++] = pr; // ans.push_back(pr); num /= pr; } if(pr > num) break; } if(num > 1) divi[n++] = num;//ans.push_back(num); return n; } int main() { IOS criba(ll(1e6)); // cout << primes.size()<> n; ll ans = 0; while(n--) { ll a; cin >> a; int sz = getpr(a); reverse(divi, divi+sz); ll t1 = 1; forn(i, sz) { ans += t1; t1 *= divi[i]; } ans += t1; } cout << ans << endl; return 0; }