#include #include #include #include #include using namespace std; long long leastFactor(long long n) { int limit = sqrt(n) + 1; if (n % 2 == 0) return 2; for (int i = 3; i < limit; i += 2) { if (n % i == 0) return i; } return n; } int main() { int n; cin >> n; long long ans; for (int i = 0; i < n; i++) { long long ai; cin >> ai; while (ai > 1) { ans += ai; ai /= leastFactor(ai); } ans++; } cout << ans << endl; return 0; }