import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for( int i = 0; i < T; i++ ) { long N = sc.nextLong(); System.out.println(isqrt(N)); } } static long isqrt(long N) { long low = 0; long high = N+1; long mid = (low+high)/2; while( low < high ) { mid = (low+high)/2; if( mid*mid <= N ) { low = mid+1; }else { high = mid; } } return low-1; } }