// // Created by ubuntu on 15/12/17. // #include #include #include using namespace std; long longestSequence(vector a) { long longest_seq=0; for(long i:a){ if(i==1) { longest_seq+=1; continue; } long ans=i; for(int j=2;j<=sqrt(i) and i>1;j++){ if(i%j==0) { i/=j; ans+=i; j--; } } //cout << ans+1 << "\n"; longest_seq+=ans+1; } return longest_seq; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); 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; }