#include #include #include #include #include #define rep(i,j,k) for(register int i = j; i <= k; i++) #define dow(i,j,k) for(register int i = j; i >= k; i--) #define ll long long using namespace std; inline ll read() { ll s = 0, t = 1; char c = getchar(); while( !isdigit(c) ) { if( c == '-' ) t = -1; c = getchar(); } while( isdigit(c) ) s = s * 10 + c - 48, c = getchar(); return s * t; } const int N = 1e6+5; int n, tot = 0; bool vis[N]; ll ans = 0, p[N], x; inline void pre(int n) { int t; rep(i,2,n) { if( !vis[i] ) p[++tot] = i; for(register int j = 1; j <= tot && (t = p[j] * i) <= n; j++) { vis[t] = 1; if( i % p[j] == 0 ) break; } } } ll q[N], num[N], l1; inline void dfs(int x,ll now) { if( !x ) { ans += now; return; } if( num[x] ) { ans += now, num[x]--, dfs(x,now*q[x]); } else { dfs(x-1,now); } } int main() { //freopen("in.txt","r",stdin); pre(1e6+5); n = read(); rep(i,1,n) { x = read(); if( x == 1 ) { ans += 1; continue; } l1 = 0; for(register int i = 1; p[i] * p[i] <= x; i++) if( x % p[i] == 0 ) { q[++l1] = p[i], num[l1] = 0; while( x % p[i] == 0 ) x /= p[i], num[l1]++; } if( x != 1 ) q[++l1] = x, num[l1] = 1; dfs(l1,1); } cout<