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

int main() {
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin) ;

	freopen("output1.txt", "w", stdout) ;
#endif
	long int t {} ;
	cin >> t ;
	while (t--) {
		long long int n{} ;
		cin >> n ;
		long int cnt{} ;
		for (long int i = 1; (i * i + (i + 1) * (i + 1)) <= n; i++)
			cnt++ ;
		cout << cnt << endl ;
	}
	return 0 ;
}