#include <bits/stdc++.h>
#include <cmath>
using namespace std;

typedef long long ll;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef queue<int> qi;
typedef queue<ll> qll;
typedef deque<int> dqi;
typedef deque<ll> dqll;

#define pb(x) push_back(x)
#define pob() pop_back()

#define r(i, s, n) for(ll i = s; i < n; i++)
#define rr(i, e, s) for(ll i = e; i >= s; i--)

#define MAX 1e9+7
#define sf bool f=true
#define fi first
#define se second
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;

// a*a = 2*b+1
// For all odd integers `a`, there exists only 1 b
// c = b+1

void solve(){

    int n;
    cin>>n;
    int ans = 0;

    for(int i = 3; i*i <= 2*n-1; i+=2){
        ans++;
    }

    cout<<ans<<endl;

}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    int t;
    cin>>t;
    while(t--) solve();



    return 0;
}
