#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
void output(long long x) {
if (x >= 10)
output(x / 10);
putchar(x % 10 + '0');
}
void solve() {
int n ; cin >> n;
long long last = 0, val = 0, ans = 0;
for (int i = 1; i <= n; i = n/val + 1) {
ans += val*(i - last);
last = i, val = n/i;
}
ans += (n+1) >> 1;
output(ans - n);
putchar('\n');
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t; cin >> t;
auto start = high_resolution_clock ::now();
while (t--)
solve();
cout << duration_cast<milliseconds>(high_resolution_clock::now() - start).count();
}