//In The Name Of The GOD #pragma comment (linker, "/stack:20000000") #pragma GCC optimize ("Ofast") #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") #include /*#include #include #include */ #define sz(s) (int)(s.size ()) #define all(s) s.begin (), s.end () #define Time clock () * 1.0 / CLOCKS_PER_SEC #define sqr(x) ((x) * 1ll * (x)) #define modfix(a,b) ((a % b + b) % b) #define bit(x) __builtin_popcountll (x) using namespace std; //using namespace __gnu_pbds; typedef unsigned long long ull; typedef long long ll; typedef long double ld; /*typedef tree, null_type, less>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;*/ //find_by_order() order_of_key() const double PI = (double)(acos (-1.0)), EPS = (double)(1e-17); const int PR = 997, MOD = 1e9 + 7, INF = 1 << 30, MXN = 1e7 + 17; const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0}; //const char nxtl = '\n'; templateinline bool updmin (T &a, const T &b) { return a > b ? a = b, 1 : 0; } templateinline bool updmax (T &a, const T &b) { return a < b ? a = b, 1 : 0; } int T = 1; int n, lp[MXN]; vectorpr; ll a[150], res; inline ll calc (ll x) { vector v; for (ll i = 2; i*i <= x; ++ i) { while (x % i == 0) { x /= i; v.push_back (i); } } if (x != 1) v.push_back (x); sort (all (v)); ll ans = 0; ll res = 1; for (int i = sz (v)-1; i >= 0; --i) { res *= v[i]; ans += res; } return ans + 1; } inline void Solve_It_Fast () { scanf ("%d", &n); for (int i = 1; i <= n; ++i) { scanf ("%lld", &a[i]); res += calc (a[i]); } printf ("%lld\n", res); } int main () { //freopen ("DeBuG.in", "r", stdin); //freopen ("OutputMain.out", "w", stdout); //scanf ("%d", &T); for (int i = 1; i <= T; ++i) { //printf ("Case %d: ", i); Solve_It_Fast (); } //printf ("\n%lf\n", Time); return 0; }