#include using namespace std; #define finish(x) return cout << x << endl, 0; #define ll long long #define scanV(a) while(n-- && cin >> x) a.push_back(x); ll n, x, ans; int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin >> n; while(n-- && cin >> x){ vector prime; ll cur = 0, p = 1; ll xx = x; for(ll i = 2 ; i*i <= x ; i++) while(xx%i == 0){ xx /= i; prime.push_back(i); } if(xx != 1) prime.push_back(xx); reverse(prime.begin(), prime.end()); for(ll i : prime){ cur += p*i; p = p*i; } ans += cur+1; } cout << ans << endl; return 0; }