#include using namespace std; #define FOR(i, a, b) for (int i = a; i <= b; i++) #define FOD(i, a, b) for (int i = a; i >= b; i--) #define REP(i, a, b) for (int i = a; i < b; i++) #define DEBUG(X) cout << #X << " = " << X << endl; #define PR(A, a, b) {cout << #A << " = "; FOR(_, a, b) cout << A[_] << " "; cout << endl;} #define fs first #define sc second typedef long long ll; typedef pair II; typedef vector BigInt; const int base = 10000; const int N = 1E6 + 10; const ll V = 1E12; void Fix(BigInt &a) { a.push_back(0); REP(i, 0, a.size() - 1) { a[i + 1] += a[i] / base; a[i] %= base; if (a[i] < 0) {a[i] += base; a[i + 1]--;} } while (a.size() >= 2 && a.back() == 0) a.pop_back(); } void operator += (BigInt &a, const BigInt b) { a.resize(max(a.size(), b.size())); REP(i, 0, b.size()) a[i] += b[i]; Fix(a); } BigInt Convert(ll x) { if (x < base) return BigInt(1, x); BigInt V; while (x > 0) { V.push_back(x % base); x /= base; } return V; } ostream& operator << (ostream& cout, const BigInt &a) { printf("%d", a.back()); FOD(i, a.size() - 2, 0) printf("%04d", a[i]); return cout; } int n; ll a[105]; bool p[N + 5]; int prime[N], cnt = 0; void Read_Input() { #ifdef LOCAL freopen("input.INP", "r", stdin); freopen("output.out", "w", stdout); #endif scanf("%d", &n); FOR(i, 1, n) scanf("%lld", &a[i]); } void Sieve() { memset(p, 1, sizeof(p)); p[1] = 0; FOR(i, 2, trunc(sqrt(N))) if (p[i]) FOR(j, i, N / i) p[i * j] = 0; FOR(i, 2, N) if (p[i]) prime[++cnt] = i; } BigInt Cal(ll n) { vector V; ll x = n; FOR(i, 1, cnt) { int dem = 0; while (x % prime[i] == 0) { x /= prime[i]; dem++; } if (dem != 0) V.push_back(II(prime[i], dem)); if (x == 1) break; } if (x > 1) V.push_back(II(x, 1)); reverse(V.begin(), V.end()); BigInt ret = Convert(1); x = n; REP(i, 0, V.size()) { while (V[i].sc > 0) { x /= V[i].fs; ret += Convert(n / x); V[i].sc--; } } return ret; } void Solve() { BigInt ans = Convert(0); FOR(i, 1, n) ans += Cal(a[i]); cout << ans; } int main() { Read_Input(); Sieve(); Solve(); //cout << Convert(1000000007); return 0; }