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