#include using namespace std; long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. long n = a.size(); long c=0; for(long i=0;i1) { if(a[i]%2==0) { int temp = a[i]; while(temp>0) { c += temp; temp /= 2; } } if(a[i]%2!=0) { int temp = a[i]; c += temp+1; } /*int f=0; for(long i=2;i<=sqrt(a[i]);i++) { if(a[i]%i==0) { f=1; } } if(f==0) { int temp =a[i]; c += temp+1; }*/ } else{ c++; } } return c; } int main() { int n; cin >> 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; }