#include using namespace std; typedef long long ll; const int lim = 1e6; ll x, ans; vector v; void run_primes() { bool ok; int i, j; v.push_back(2); for(i=3; i p; int i; for(i=0; i 1; ++i) while(x % v[i] == 0) { x /= v[i]; p.push_back(v[i]); } if(x > 1) p.push_back(x); ll ans = 1; for(auto it : p) ans = ans * it + 1; return ans; } int main() { run_primes(); int n; cin >> n; while(n--) { cin >> x; ans += solve(x); } cout << ans << '\n'; return 0; }