#include #include using namespace std; int is_prime(long long int n){ for(int i = 2; i <= sqrt(n); ++i){ if(n % i == 0) return i; } return -1; } int main() { long long int n,a[100001]; cin >> n; for(int i = 0; i < n; ++i) cin >> a[i]; long long int tot = 0; for(int i = 0; i < n; ++i){ if(a[i] == 1) tot ++; else{ if(is_prime(a[i]) == -1) tot += a[i]+1; else{ while(is_prime(a[i]) != -1){ tot += a[i]; a[i] /= is_prime(a[i]); } tot += a[i]+1; } } } cout << tot << endl; }