#include #define ff(i,a,b) for(int i=(a), _b=(b); i<=_b; ++i) #define gg(i,a,b) for(int i=(a), _b=(b); i>=_b; --i) #define REP(i,b) for(int i=(0), _b=(b); i< _b; ++i) #define endl '\n' #define long long long #define ALL(x) (x).begin(), (x).end() #define Love(a) {cerr << #a << " = " << a << endl;} #define _ << "," << #define BIT(i, x) (((x)>>(i))&1) #define X first #define Y second #define NAME "BreakingSticks" using namespace std; const int N = 107; typedef pair ii; int n; long a[N]; void Enter() { cin >> n; ff(i, 1, n) cin >> a[i]; } inline void maxi(long &a, long b) { if (a < b) a = b; } long Count(long T) { vector v; long x = T; ff(i, 2, trunc(sqrt(T))) if (x % i == 0) { int cnt = 0; while (x % i == 0) x /= i, ++cnt; v.push_back({i, cnt}); } if (x > 1) v.push_back({x, 1}); sort(ALL(v), greater()); long res = 1, cur = 1; for (ii e : v) { ff(z, 1, e.Y) res += (cur *= e.X); } return res; } void Process() { long res = 0; ff(i, 1, n) { res += Count(a[i]); } cout << res << endl; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen(NAME".inp", "r", stdin); //freopen(NAME".out", "w", stdout); Enter(); Process(); return 0; }