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