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