#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; i 1) { sum += current; long ub = sqrt(current); long j; for (j=2; j <= ub; ++j) { if (current%j==0) { current = current / j; break; } } if (ub < 2 || j > ub) { current = 1; } } sum += 1; } 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); cout << result << endl; return 0; }