#include <bits/stdc++.h>

#define taskname "test"

using namespace std;

typedef long long LL;

const int maxn = 100 + 7;

int n;
LL res;
LL a[maxn];

template <typename T> inline void read(T &x){
    x = 0; char ch; int positive = 1;
    while (!isdigit(ch = getchar())) if (ch == '-') positive = 0;
    do x = x * 10 + ch - '0'; while (isdigit(ch = getchar()));
    if (!positive) x = -x;
}

void input() {
    read(n);
    for(int i = 1; i <= n; ++i) read(a[i]);
}

void solve() {
    for(int i = 1; i <= n; ++i) {
        LL x = a[i];
        res += x;
        for(int j = 2; j <= sqrt(a[i]); ++j)
        if (x % j == 0) {
            while (x % j == 0) {
                x = x / j;
                res += x;
            }
            if (x == 1) break;
        }
        if (x > 1) res += 1;
    }
    printf("%lld", res);
}

int main() {
    //freopen(taskname".inp","r",stdin);
	//freopen(taskname".out","w",stdout);
	input();
	solve();
	return 0;
}