import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); start: for (int i = 0; i < t; i++) { long n = sc.nextLong(); for (long j = (int) (Math.sqrt(n) - 1); j <= n+1; j++) { if (j * j > n) { System.out.println(j - 1); continue start; } } } } }