#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define oo 1e9 #define tr(c, it) for(typeof((c).begin()) it = (c).begin(); it != (c).end(); it++) #define fi first #define se second #define pb push_back #define ll long long #define all(c) c.begin(), c.end() #define PRE(i, m, n) for(int (i)=(m);(i)<(n);++(i)) #define present(container, element) (container.find(element) != container.end()) #define cpresent(container, element) (find(all(container), element) != container.end()) #define FOR(i,n) for(int (i)=0;(i)<(n);++(i)) //#define MAX 1e12 + 1 using namespace std; typedef pair II; typedef vector VI; typedef vector VII; typedef vector VVI; typedef vector VVII; ll MaxMove(ll N) { ll max_move = 1; for(ll f = 2; f*f <= N; ++f) { while(N % f == 0) { max_move = max_move*f + 1; N /= f; } } if (N > 1) max_move = max_move*N + 1; return max_move; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll sum = 0; ll t; int n; cin >> n; FOR(k, n) { cin >> t; sum += MaxMove(t); } cout << sum; return 0; }