#include #include using namespace std; #define ULL unsigned long long int ULL getfact(ULL x) { for (int i = 2; i <= sqrt(x); ++i) { if (x % i == 0) return i; } return x; } ULL comp(ULL x) { if (x == 1) return 1; return x + comp(x/getfact(x)); } int main() { int n; cin >> n; ULL ans = 0; for (int i = 0; i < n; ++i) { ULL x; cin >> x; ans += comp(x); } cout << ans << endl; }