#include typedef long long ll; using namespace std; vectorp; void sieve(){ vectorisp(1e6 + 5, 1); for(int i = 2; i < 1e6 + 5; i++){ if(isp[i]){ p.push_back(i); for(int j = 2 * i; j < 1e6 + 5; j += i) isp[j] = 0; } } } int main(){ ios_base::sync_with_stdio(0); sieve(); int n; cin >> n; ll res = 0; while(n--){ ll tmp; cin >> tmp; if(tmp == 1){ res++; continue; } res += tmp + 1; for(int i = 0; i < p.size(); i++){ while(tmp % p[i] == 0){ tmp /= p[i]; if(tmp == 1) break; res += tmp; } } } cout << res << endl; return 0; }