#pragma GCC optimize("O3", "inline")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define ub upper_bound
#define INF 1e18 + 100
ll solve()
{
int n;
cin >> n;
ll ans = 0;
ll i = 1;
for(; i * i <= n; i++){
ans = ans + (n / i) - 1;
}
while(i <= n){
ll j = n / (n / i);
ans = ans + (j - i + 1) * (n / i - 1);
i = j + 1;
}
return ans;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
cin >> t;
while(t--)
{
ll x = solve();
cout << x << "\n";
}
return 0;
}