#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define MAX 2000000000
vector<ll> feaseable;
void setfun(){
    for(ll i = 3; i<MAX; i+=2){
        ll sq = i * i;
        if(sq>MAX){
            break;
        }
        ll c = (sq + 1)/2;
        feaseable.push_back(c);
    }
}

int main(){
    int t;
    cin>>t;
    setfun();
    while(t--){
        int n;
        cin>>n;
        auto x = upper_bound(feaseable.begin(),feaseable.end(),n);
        int ans = x - feaseable.begin();
        cout<<ans<<endl;
    }
    return 0;
}