#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
}
const int N = 1e6+6;
int val[N];
void calc()
{
for(int i=1;i<N;i++)
{
for(int j=2*i;j<N;j+=i)
{
val[j]++;
}
}
for(int i=2;i<N;i++)
{
val[i] = val[i-1] + val[i];
}
}
void solve()
{
int n;cin>>n;
cout<<val[n]<<endl;
}
signed main()
{
//edm();
calc();
int t = 1;
cin>>t;
for(int i=1;i<=t;i++)
{
///cout<<"Case "<<i<<": ";
solve();
}
}