#include <bits/stdc++.h>

using namespace std;

int main() {  
    int n;
    scanf("%d", &n);
    
    long long ans = 0;
    while (n--) {
        long long x;
        scanf("%lld", &x);
        
        ans += x;
        for (int d = 2; d * 1ll * d <= x; d++)
            while (x % d == 0) {
                x /= d;
                ans += x;
            }
        
        if (x > 1) ans += 1;
    }
    
    printf("%lld\n", ans);
 
    return 0;
}