#include #define FOR(i,a,b) for(long long i=(a);i<=(b);++i) #define NFOR(i,a,b) for(int i=(a);i>=(b);--i) #define pb push_back #define ll long long #define F first #define PI 3.14159265358979323846264338327 #define S second #define all(v) v.begin(),v.end() #define trace(x) cout << '>' << #x << ':' << x << endl; #define trace2(x,y) cout<< '>' << #x << ':' << x << " | " << #y << ':' << y << endl; #define fast ios_base::sync_with_stdio(false); cin.tie(NULL) #define MOD 1000000007 using namespace std; ll prime(ll x) { if(x==1) return 0; for(ll i=2;i*i<=x;++i) { if(x%i==0) return 0; } return 1; } int main() { fast; //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ll t,n,m,x,y; cin>>n; ll arr[n+1]; FOR(i,1,n) cin>>arr[i]; ll gsum=0; FOR(i,1,n) { gsum+=arr[i]; ll val=arr[i]; if(val==1)continue; while(1) { if(prime(val)) { gsum+=1LL; break; } else if(val%2==0) { gsum+=val/2; val/=2; } else if(val==1) { gsum+=1LL; break; } else { for(ll j=2;j*j<=val;++j) { if(val%j==0) { gsum+=val/j; val/=j; break; } } } } } cout<