#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define endl '\n'
#define debug cout<<"HERE"<<endl;
#define ff first
#define ss second
void edm()
{
ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
int koto(int n,int r,int d)
{
int val = (r-n)/d + 1;
return val;
}
void solve()
{
int n;cin>>n;
int ans=0;
ans = n-1;
int now=1;
for(int i=2;i*i<=n;i++)
{
int k = 2*koto(i*i,n,i) - 1;
// cout<<k<<endl;
ans+=k;
}
cout<<ans<<endl;
}
signed main()
{
//edm();
int t = 1;
cin>>t;
for(int i=1;i<=t;i++)
{
///cout<<"Case "<<i<<": ";
solve();
}
}