#include"bits/stdc++.h" using namespace std ; typedef long long ll; ll A[20004]; long long x; int main() { int N; scanf("%d",&N); long long ans=0; for(int j=1;j<=N;j++) { scanf("%lld",&x); long long y=x; if(x==1) { ans++; continue; } vector X; while(x%2==0) { X.push_back(2); x/=2; } for(long long i=3;i<=sqrt(x);i+=2) { while(x%i==0) { X.push_back(i); x/=i; } } if(x>1) X.push_back(x); sort(X.begin(),X.end()); ans+=y; for(int i=0;i