#include #include #include #include #include using namespace std; int main() { int n; cin >> n; long double ans=0; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; long double tot=0; while(a[i]!=0){ if(a[i]==1){ tot=tot+1; break; } if(a[i]==2){ tot=tot+3; break; } if(a[i]==3){ tot=tot+4; break;} if(a[i]%2==0){ tot=tot+a[i]; a[i]=a[i]/2; } else{ int j; int k=sqrt(a[i]); for( j=2;j<=k;j++){ if(a[i]%j==0){ tot=tot+a[i]; a[i]=a[i]/j; break; } } if(j==k+1) { tot=tot+a[i]+1; break; } } } ans=ans+tot; } printf("%.0Lf",ans); /* Enter your code here. Print output to STDOUT */ return 0; }