N=int(input()) def sq(N): X=int(N**0.5)-1 while X**2<=N: X+=1 return X-1 for _ in range(N): print(sq(int(input())))