#include <bits/stdc++.h>
using namespace std;
void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
bool desc(long long a, long long b) { return a > b; }
bool prime[1000001];
int ans = 0;
void dfs(int key, int vis[], vector<int> v[]) {
  vis[key] = 1;
  for (int i = 0; i < v[key].size(); i++) {
    if (!vis[v[key][i]]) {
      ans++;
      dfs(v[key][i], vis, v);
    }
  }
}
int main() {
  fast();
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long sum = n, j = 1;
    for (int i = 1; i <= 60; i++) {
      j *= 2;
      sum += n / j;
    }
    cout << sum << endl;
  }
}
