#include using namespace std; typedef long long ll; #define rep(a) for(int i=0;ia;i--) #define pans(a) cout<'9';ip = getchar_unlocked()) if (ip == '-') { flag = -1;ip = getchar_unlocked();break; } for (;ip >= '0'&&ip <= '9';ip = getchar_unlocked())ret = ret * 10 + ip - '0'; return flag*ret; } long long find_biggest_factor(long long x){ if(x<=2) return 1; bool isPrime = true; for(int i=2;i<=sqrt(x)+1;i++){ if(x%i==0){ isPrime = false; return x/i; } } return 1; } int main() { long long ans = 0; int test; test=sc(); while(test--) { long long n; cin>>n; ans += n; while(n>1){ n = find_biggest_factor(n); ans += n; } } cout<