#include "bits/stdc++.h" using namespace std; #define ll long long int ll solve(ll x) { if(x == 1) return 1LL; bool is_prime = true; int i; for(i = 2 ; i <= sqrt(x) ; i++) { if(x % i == 0) { is_prime = false; break; } } if(is_prime) return x + 1; else return (x + solve(x / i)); } int main() { int n; scanf("%d", &n); ll ans = 0; while( n-- ) { ll x; scanf("%lld", &x); ans += solve(x); } printf("%lld", ans); return 0; }