#include using namespace std; long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. long sum,ts=0,i,n,prime; for(i=0;i1) {for (int j=2;j<=n;j++) { while(n%j==0) { n=n/j;sum+=n;} }} ts+=sum;} return(ts); } int main() { 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; }