#include #define ll long long #define pb push_back #define pii pair #define ull unsigned long long #define mp make_pair #define s second #define f first #define _ ios_base::sync_with_stdio(false);cin.tie(0); using namespace std; const int MAXN = (int)(2e5)+2; const int MOD = (int)(1e9)+7; int main() { _ int n; cin >> n; ll ans=0; for (int i = 1; i <= n; i++) { ll x; cin >> x; ans += x; for (int j = 2; j * 1ll * j <= x; j++) { if (x % j==0) { while(x%j==0) { ans += x / j; x /= j; } } } if (x > 1) { ans++; x = 1; } } cout << ans; return 0; }