/*input
3
1 7 24
*/
#include <bits/stdc++.h>

using namespace std;

int main () {
	int n;
	cin >> n;

	long long ats = 0;

	for (int i = 0; i < n; i++) {
		long long x;
		cin >> x;
		ats += x;
		long long pr = x;

		for (long long i = 2; i * i <= x;) {
			if (x % i == 0) {
				ats += x / i;
				x /= i;
			}
			else
				i++;
		}

		if (x > 1)
			ats++;

		//cout << ats << endl;
	}

	cout << ats;


	return 0;
}