t=int(input()) for i in range(t): n=int(input()) m=int(n**0.5) if m**2<=n: print(m) else: print(m-1)