#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const int SIZE = 1 << 10; int pointer = SIZE; char buffer[SIZE]; char Advance() { if (pointer == SIZE) { fread(buffer, 1, SIZE, stdin); pointer = 0; } return buffer[pointer++]; } int Read() { int answer = 0; char ch = Advance(); while (!isdigit(ch)) ch = Advance(); while (isdigit(ch)) { answer = answer * 10 + ch - '0'; ch = Advance(); } return answer; } map dp; long long Solve(long long x) { vector temp; for (long long d = 2; d * d <= x; d++) while (x % d == 0) { temp.push_back(d); x /= d; } if (x != 1) temp.push_back(x); reverse(temp.begin(), temp.end()); long long answer = 1, add = 1; for (auto &it : temp) { add *= it; answer += add; } return answer; } int main() { //freopen("tema.in", "r", stdin); //freopen("tema.out", "w", stdout); int n; scanf("%d", &n); long long answer = 0; for (int i = 1; i <= n; i++) { long long x; scanf("%lld", &x); answer += Solve(x); } printf("%lld\n", answer); return 0; }