#include using namespace std; #define ll long long ll calc(ll x) { ll tmp=x; while(true) { if(x&1) { tmp+=1; break; } else { x/=2; tmp+=x; } } // cout<< tmp <> n; ll a[n+1]; for(ll i = 0; i < n; ++i) { cin >> a[i]; if(a[i]==1) sum+=1; else if(a[i]==2) sum+=3; else sum+=calc(a[i]); } cout << sum << endl; return 0; }