#include using namespace std; int main() { int n,i,p; long long ans=0,temp,cnt; bool prime[1000001]; vector list; memset(prime, true, sizeof(prime)); for (p=2; p*p<=1000000; p++) { // If prime[p] is not changed, then it is a prime if (prime[p] == true) { // Update all multiples of p for (i=p*2; i<=1000000; i += p) prime[i] = false; } } for(i=2;i<=1000000;i++) if(prime[i] == true) list.push_back(i); cin >> n; while(n--) { cnt = 1; cin >> temp; if(temp == 6) ans += 10; else { for(i=0;i 1;i++) { while(temp > 1 && temp%list[i] == 0) { cnt = cnt*list[i] + 1; temp /= list[i]; } } if(temp > 1) cnt = cnt*temp + 1; ans += cnt; } } cout << ans; return 0; }