#include <bits/stdc++.h>
using namespace std;
void solver() {
  int n, k, x, y, ans = 0, u;
  double r;
  cin >> n;
  r = sqrt(n);
  ans = ceil(r * 2) - 2;
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  cin >> t;
  while (t--) {
    solver();
  }
  return 0;
}
