#include using namespace std; int factor(int a){ vector v; int total=0; for(int i=2;i<(a/2);i++){ if(a%i==0) v.push_back(i); } for(int i=v.size()-1;i>=0;i-=2){ total+=(a/v[i]); //cout << (a/v[i]) << endl; } return total; } long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. int n=1000000; long long total=0; bool prime[n+1]; memset(prime, true, sizeof(prime)); for (int p=2; p*p<=n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p] == true) { // Update all multiples of p for (int i=p*2; i<=n; i += p) prime[i] = false; } } for(int i=0;i> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a); cout << result << endl; return 0; }