#include using namespace std; long longestSequence(vector a,int n) { int d=2; long sum; // Return the length of the longest possible sequence of moves. for(int i = 0; i < n; i++) { while(a[i]!=1) { while(a[i]%d!=0) { d++; } //a[i]=a[i]/d; sum=sum+a[i]; a[i]=a[i]/d; } sum=sum+1; d=2; } return sum; } 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,n); cout << result << endl; return 0; }