#include #define fn1 "" using namespace std; const int mn = 1 * int(1e5) + 10; const int mod = 1 * int(1e5) + 10; const int mm = 1 * int(1e5) + 10; int tt, ntest = 1; long long v[(int)(1e7)]; int n; void docfile() { ios::sync_with_stdio(false); cin.tie(nullptr); if (ifstream("test.inp")) { freopen("test.inp", "r", stdin); freopen("test.out", "w", stdout); }else if (ifstream(fn1".inp")) { freopen(fn1".inp", "r", stdin); freopen(fn1".out", "w", stdout); } } template inline void read(T& x) { x = 0; T f = 1; char ch = getchar(); while (!isdigit(ch)) f = ch == '-' ? - f : f, ch = getchar(); while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); x *= f; } template inline void write(T a) { int i = 0; char S[20]; if (a == 0) {putchar('0'); return;} while(a > 0) { S[i++] = a % 10 + '0'; a /= 10; } --i; while(i >= 0) putchar(S[i--]); } long long f (long long x) { int vc = 0; long long X = x; int tr = trunc(sqrt(x)); for (int i = 2; i <= tr; ++ i) { while (x % i == 0) { v[vc ++] = i; x /= i; } } if (x != 1) v[vc ++] = x; x = X; long long res = 1; for (int i = vc - 1; i >= 0; -- i) { X /= v[i]; res += x / X; } return res; } void enter() { int n; long long sol = 0; cin >> n; for (int i = 0; i < n; ++ i) { long long x; cin >> x; sol += f (x); } cout << sol; } void solve() { } void print_result() { } int main() { docfile(); //cin>>ntest; for (tt = 1; tt <= ntest; ++ tt) { enter(); solve(); print_result(); } }