#include<bits/stdc++.h>
using namespace std;

#define forw(i,a,n) for (int i=a;i<n;i++)
#define ford(i,a,n) for (int i=n-1;i>=a;i--)
#define fi first
#define se second
#define SZ(x) ((int)(x).size())

typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;

const ll mod=1000000007;
const int maxn = 1e5 + 3;
void mf(){
	freopen("input.in","r",stdin);
	//freopen("output.ou","w",stdout);
}
//START SOL
ll f(ll x){			
	ll i = 2;
	ll ans = 1;
	ll y = x;
	while(i*i <= x && y > 1){
		while(y % i == 0){
			ans = 1 + i*ans; 
			y/= i;
		}
		i++;
	}
	if( y > 1 ){
		ans = 1 + y * ans;
	}
	return ans;	
}
ll n,a;
void solve(){	
	cin>>n;
	ll res = 0;
	forw(i, 0, n){
		cin>>a;
		res+=f(a);
	}
	cout<<res;
}

int main(){
	ios_base::sync_with_stdio(false);
	#ifdef tuanh
		mf();
	#endif
	solve();
	return 0;
}