#include void solve() { int n; std::cin >> n; n = n * 2 - 1; auto m = n; int ans = 0; while (true) { int k = __builtin_ctz(m + 1); ans += k; m >>= k; if (m == 0) break; m += n; } std::cout << ans << "\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int q; std::cin >> q; while (q--) solve(); return 0; }