#include using namespace std; #define ll long long bool prime[1000001]; void SieveOfEratosthenes(int n) { //int n = 1000001; // Create a boolean array "prime[0..n]" and initialize // all entries it as true. A value in prime[i] will // finally be false if i is Not a prime, else true. memset(prime, true, sizeof(prime)); for (int p=2; p*p<=n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p] == true) { // Update all multiples of p for (int i=p*2; i<=n; i += p) prime[i] = false; } } // Print all prime numbers /*for (int p=2; p<=n; p++) if (prime[p]) cout << p << " ";*/ } int isprime(ll n) { for(int i=2;i*i<=n;i++) { if(n%i==0) { return 0; } } return 1; } int main() { long long n; cin >> n; vector a(n); long double sum = 0; for(int i = 0; i < n; i++) { cin >> a[i]; // SieveOfEratosthenes(a[i]); if(a[i]==1) { sum+=1; } else { int flag=0; for(ll j=2;j*j<=a[i];j++) { if(a[i]%j==0) { flag=1; break; } } if(flag==0) { sum+=a[i]+1; } else { // SieveOfEratosthenes(1000001); ll k = 2; ll x = a[i]; //sum+=x+1; while(x%2==0) { sum+=x; x=x/2; //sum+=x; } for(int j=3;j<=sqrt(x);j+=2) { while(x%j==0) { //cout<