/// Md.ASADUZZAMAN /// Dept of ICT /// MBSTU #include using namespace std; #define ll long long #define ull unsigned long long #define fr(i,a,b) for(int i=(a);i<(b);i++) #define rfr(i,a,b) for(int i=(b-1);i>=(a);i--) #define freach(i, c) for( __typeof( (c).begin() ) i = (c).begin(); i != (c).end(); ++i ) #define rep(i,n) for(int i=0;i<(n);i++) #define rrep(i,n) for(int i=(n)-1;i>=0;i--) #define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++) #define PINF INT_MAX #define MINF INT_MIN #define pb push_back #define m_p make_pair #define all(a) (a).begin(),(a).end() #define mset(a,c) memset(a,c,sizeof a) #define clr(a) memset(a,0,sizeof a) #define pii pair #define pll pair #define pcc pair #define pic pair #define pci pair #define psi pair #define pis pair #define ff first #define ss second #define vs vector #define vi vector #define vll vector #define vpi vector > #define vpl vector > #define vpcl vector > #define vpsl vector > #define qi queue #define ql queue #define qll queue #define PQ priority_queue #define mpii map #define mpsl map #define mpcl map #define mpll map #define mpss map #define stl set #define sts set /// Bug #define bug(x) cout<<#x<<": "<eps+(y)?1:0)) #define sqr(x) x*x ///I/O #define input() freopen("in0.txt","r",stdin) #define output() freopen("out0.txt","w",stdout) #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ppc(x,y) cout<inline string toString(T a) { ostringstream os(""); os << a; return os.str();} templateinline ll toLong(T a) {ll res; istringstream os(a); os >> res; return res;} ///----------------------Main Code-------------------------------------/// ll factor(ll N) { ull b = N; vector fact; vector pow; for (ull f = 2; f * f <= N; ++f) { int p = 0; while (N % f == 0) { N /= f; fact.push_back(N); } } ll sm = 0; fr(i, 0, fact.size()) sm += fact[i]; return sm; } int main() { #ifndef ONLINE_JUDGE // input(); // output(); #endif fast(); // clock_t begin, end; // double time_spent; // begin = clock(); ll n, x, y, a, b, c, t, q; string s; //char c; //cin>>t; while (cin >> n) { vll v; ll sm = 0; fr(i, 0, n) { cin >> x; v.pb(x); } fr(i, 0, v.size()) { x = v[i]; if(x>1) sm += (1 + factor(x) + x); else sm =x; } cout << sm << endl; //bug(n); } // end = clock(); // time_spent = (double)(end - begin) / CLOCKS_PER_SEC; // cout<<"Time spent = "<