#include using namespace std; long long ans, x, subans; int n; vector v; void factorize(long long x) { v.clear(); for(long long i = 2; i * i <= x; i++) while(x % i == 0) { v.push_back(i); x /= i; } if(x != 1LL) v.push_back(x); } int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%lld", &x); factorize(x); subans = 1LL; for(auto it : v) { subans *= it; subans++; } ans += subans; } printf("%lld\n", ans); return 0; }