#include #define pll pair #define st first #define nd second using namespace std; long long n; long long a[105], res=0, c; long long isPrime(long long x, long long start){ long long root = sqrt(x); if(x==1) return 1; if(x==2) return -1; for(long long i=start;i<=root;i++){ if(x%i==0) return i; } return -1; } long long mypow(long long p, long long x){ if(x==1) return p; if(x==2) return p*p; long long tmp = mypow(p, x>>1); if(x%2==0) return tmp*tmp; return tmp*tmp*p; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++){ long long tmp = a[i]; long long j = 2LL; if (isPrime(tmp, 2)==-1) { res += tmp+1LL; } else { stack ss; while(tmp!=1) { //cout<