#include using namespace std; typedef long long ll; ll ans = 0; void solve(ll x) { while (x % 2 == 0) { ans += x; x /= 2; } ll i = 3; while (i <= sqrt(x)) { while (x % i == 0) { ans += x; x /= i; } i += 2; } if (x != 1) ans += x; } int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; ll x; ans = n; while (n--) { cin >> x; solve(x); } cout << ans; return 0; }