#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {  
    int n;
    long long x,v,ans=0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        ans += x;
        for(long long j = 2; j <= sqrt(x); j++){
            while(x%j==0){
                x /= j;
                ans += x;
            }
        }
        if(x != 1){
            ans++;
        }
    }
    cout << ans;
    /* Enter your code here. Print output to STDOUT */   
 
    return 0;
}