#include #define pb push_back #define mp make_pair #define fi first #define se second #define eb emplace_back #define mt make_tuple using namespace std; typedef long long ll; typedef pair ii; ll calc(ll x) { if (x == 1) return 1; vector v; ll xx = x; for (ll i = 2; i * i <= xx; i++) { while (xx % i == 0) { v.pb(i); xx /= i; } } if (xx > 1) v.pb(xx); ll ans = v[0] + 1; for (int i = 1; i < v.size(); i++) { ans *= v[i]; ans++; } return ans; } int main() { int n; scanf("%d", &n); ll ans = 0; for (int i = 0; i < n; i++) { ll x; scanf("%lld", &x); ans += calc(x); } printf("%lld\n", ans); return 0; }