#include #include int64_t f(int64_t x) { int64_t c = x; int64_t res = x; for (int64_t d = 2; d * d <= c; ++d) { while (c % d == 0) { c = c / d; res += c; } } if (c > 1) { res += 1; } return res; } int main() { int n; scanf("%d", &n); int64_t res = 0; for (int i = 0; i < n; ++i) { int64_t x; scanf("%" SCNd64, &x); res += f(x); } printf("%" PRId64 "\n", res); return 0; }