class Solution:
    def countSquares(self, N):
        # code here 
        ans = int(math.sqrt(N-1))
        
        return ans

#{ 
#  Driver Code Starts
#Initial Template for Python 3
import math

if __name__ == '__main__': 
    t = int (input ())
    for _ in range (t):
        N=int(input())
        
        ob = Solution()
        print(ob.countSquares(N))
# } Driver Code Ends
55690a553daad894bb9b5a702486192697de9960
class Solution:
    <mask token>


<mask token>

class Solution:

    def countSquares(self, N):
        ans = int(math.sqrt(N - 1))
        return ans


<mask token>

class Solution:

    def countSquares(self, N):
        ans = int(math.sqrt(N - 1))
        return ans


<mask token>
if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        N = int(input())
        ob = Solution()
        print(ob.countSquares(N))

class Solution:

    def countSquares(self, N):
        ans = int(math.sqrt(N - 1))
        return ans


import math
if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        N = int(input())
        ob = Solution()
        print(ob.countSquares(N))

class Solution:
    def countSquares(self, N):
        # code here 
        ans = int(math.sqrt(N-1))
        
        return ans

#{ 
#  Driver Code Starts
#Initial Template for Python 3
import math

if __name__ == '__main__': 
    t = int (input ())
    for _ in range (t):
        N=int(input())
        
        ob = Solution()
        print(ob.countSquares(N))
# } Driver Code Ends