#include using namespace std; long solve(long x) { long ans = x; for (long i = 2; i*i <= x; i++) { while(x % i == 0) { x /= i; ans += x; } } if (x != 1) { ans++; } return ans; } long longestSequence(vector & a) { long s = 0; for (int i = 0; i < a.size(); i++) { s += solve(a[i]); } return s; } 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; }