#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

LL ds[100];

void solve() {
    int n;
    scanf("%d", &n);
    
    LL ans = 0;
    
    for (int i = 1; i <= n; i++) {
        LL a;
        scanf("%lld", &a);
        int sz = 0;
        ans += a;
        LL t = a;
        for (LL j = 2; a > 1 && j*j <= t; ++j) {
            while (a % j == 0) {
                ds[sz++] = j;
                a /= j;
            }
        }
        if (a > 1) {
            ds[sz++] = a;
        }
        LL now = 0;
        for (int j = 0; j < sz; j++) {
            now = now * ds[j] + 1;
        }
        ans += now;
    }
    
    printf("%lld", ans);
}

int main() {
    int ct = 1;

    while (ct--) solve();
}