#include using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair #define sz(a) int(a.size()) #define all(v) v.begin(), v.end() #define bpc(v) __builtin_popcountll(v) #define IOS ios_base :: sync_with_stdio(false); cin.tie(NULL); #define sc scanf #define pr printf #define itr iterator #define ioi(i, a, b) for (int i = a; i <= b; ++i) #define IOI(i, a, b) for (int i = a; i >= b; --i) #define ub upper_bound #define lb lower_bound const int N = 2e2 + 5; const int inf = 1e9 + 1; const int mod = 1e9 + 9; const double eps = 1e-15; const int pw = 257; ll calc(ll a) { vector b; for (ll i = 2; i * i <= a; ++i) { while (a % i == 0) { b.pb(i); a /= i; } } if (a > 1) b.pb(a); ll cnt = 1, res = 1; for (int i = sz(b) - 1; i >= 0; --i) { cnt *= b[i]; res += cnt; } return res; } int main() { #ifdef Madi freopen(".in", "r", stdin); //freopen(".out", "w", stdout); #endif IOS int n; cin >> n; ll ans = 0; for (int i = 1; i <= n; ++i) { ll a; cin >> a; ans += calc(a); } cout << ans; return 0; }