#include using namespace std; long long longestSequence(vector a) { long long ans = 0; for (long e : a) { long long fac[1000001]; long i = 0; long temp = e; long long x = 1; while (temp%2==0) { temp /= 2; fac[i++] = 2; } for (int j = 3; j <= sqrt(temp); j+=2) { while (temp%j == 0) { temp /= j; fac[i++] = j; } } if (temp > 2) fac[i++] = temp; x += fac[i-1]; for (int j = i - 2; j >= 0; j--) { fac[j] = fac[j]*1LL*fac[j+1]; x += fac[j]; } ans += x; } return ans; } int main() { ios_base::sync_with_stdio(0); int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a); cout << result << endl; return 0; }