#include #pragma GCC optimize("O3") using namespace std; typedef long long int LL; typedef pair II; typedef vector< II > VII; typedef vector VI; typedef vector< LL > VLL; typedef vector< VI > VVI; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #define ALL(a) a.begin(),a.end() #define SET(a,b) memset(a,b,sizeof(a)) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define si(n) scanf("%d",&n) #define dout(n) printf("%d\n",n) #define sll(n) scanf("%lld",&n) #define lldout(n) printf("%lld\n",n) #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL) #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template void __f(const char* name, Arg1&& arg1){ cerr << name << " : " << arg1 << std::endl; }template void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...); } #else #define trace(...) #endif //FILE *fin = freopen("in","r",stdin); //FILE *fout = freopen("out","w",stdout); int main(){ int rim[1000006]; VI primes; REP(i, 1000006)rim[i] = 1; rim[1] = 0; FOR(i, 2, 1000006){ if(rim[i]){ primes.PB(i); int j; for(j = i*2;j < 1000006;j += i){ rim[j] = 0; } } } int n; si(n); LL fans = 0; REP(i, n){ LL x, ans; VLL divs; sll(x); ans = 1; for(auto p: primes){ while(x%p == 0){ ans *= p; ans++; x /= p; } } if(x != 1){ ans *= x; ans++; } fans += ans; } lldout(fans); return 0; }