#include using namespace std; #define ll long long #define sd(x) scanf("%d", &(x)) #define vi vector #define pb push_back vi primes; const int N = 1e6; int factor[N], mu[N]; void pre(){ for(int i = 2;i*i n) break; if(n % p == 0){ while(n % p == 0){ n /= p; ret += n; } } } if(n != 1){ ll p = n; while(n % p == 0){ n /= p; ret += n; } } return ret; } int main(){ pre(); int n; cin >> n; long long Ans = 0; for(int i = 1; i <= n; i++){ ll x; cin >> x; Ans += ans(x); } cout << Ans << endl; return 0; }