from math import sqrt t=int(input()) for i in range(t): x=int(input()) y=int(sqrt(x)) if y**2>x: print(y-1) else: print(y)