#include using namespace std;/* long long int longestSequence(vector a) { long long int sum=0,i; for(i=0;i1) { for(ik = 2; ik <= n / 2; ++ik) { if(n % ik == 0) { isPrime = false; break; } } if(isprime){ } sum=sum+x; x=x/2; } sum=sum+1; } else if(x==1) { sum=sum+1; } else { sum=sum+Sieve(x); } } return sum; }*/ long long int longestSequence(vector a) { long long int sum=0,i; for(i=0;i1){ while(x%2==0){ sum=sum+x; x=x/2; } if(x==1){ sum=sum+1; break; } bool flag2=true; for(long long int j=3;j<=sqrt(x);j++){ if(x%j==0){ sum=sum+x; x=x/j; flag2=false; break; } } if(flag2==true){ sum=sum+x+1; break; } } } } return sum; } int main() { long long int n; cin >> n; if(n>=1&&n<=100){ vector a(n); for(long long int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; if(a[a_i]<1&&a[a_i]>=10000000000000){ return 0; } } long long int result = longestSequence(a); cout << result << endl; } return 0; }