import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		int res = 0;
		for (int a = 3; ; a += 2)
		{
			int d = a * a;
			int b = d / 2;
			int c = d - b;
			if (c > n)
			{
				break;
			}
			res += 1;
		}
		writeln (res);
	}
}
