#include using namespace std; #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); #define ll long long bool prime(int n) { bool ans = true; if(n > 2) { for(int i=2; i<=sqrt(n); i++) { if(n%i == 0) { ans = false; break; } } } return ans; } int main() { /* freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); */ fast int t, n, ans = 0; cin>>t; while(t--) { cin>>n; if(n == 1) { ans++; } else { ll int tempa = n, temp = 1, parts = 1; while(n!=0) { if(prime(n)) { temp = temp + tempa; n = 0; } else if (n%2 != 0) { int lol; for(int i=1; i<=sqrt(n); i++) { if(n%i == 0) { lol = n/i; temp += parts*(n/i); } } n = 0; } else { if(n%3 == 0) { n = n/3; parts = parts*3; temp = temp + (parts); } else { n = n/2; parts = parts*2; temp = temp + (parts); } } } ans = ans + temp; } } cout<