/*writer:houpingze 绿√*/
/*
Note:

*/
#include<bits/stdc++.h>
#define reg register int
#define INF (1<<30) 

using namespace std; 
int n,cnt,m,a,ans,t;
signed main() {
	ios::sync_with_stdio(false);
	cin>>t;
	while(t--){
		cin>>n;
		for(int i=1;i<=n;i++){
			int x=(i*i)/2; 
			if(x>n||i*i-x>n) break;
			if(x>=1&&i*i+x*x==(i*i-x)*(i*i-x)){
				cnt++;
			} 
		}
		cout<<cnt<<endl;
		cnt=0;
	}
    return 0;
}

