#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unrolled-loops")
using namespace std;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 9;
const long long INF = 1e15;
const long long oo = 2e18 + 7;
const long long base = 31;
const double eps = 1e-8;
int test = 1;
void FlyingTuna() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ifstream *fi = new ifstream(
      "TestCode"
      ".inp");
  ofstream *fo = new ofstream(
      "TestCode"
      ".out");
  if (*fi) {
    cin.rdbuf(fi->rdbuf());
    cout.rdbuf(fo->rdbuf());
  }
}
int n;
void In() { cin >> n; }
void Solve() {
  In();
  int ans = 1e9 + 7;
  int tmp, x;
  for (int i = 1; i <= sqrt(n) + 5; i++) {
    tmp = i - 1;
    x = i;
    tmp += (n - 1) / x;
    ans = min(ans, tmp);
  }
  cout << ans << '\n';
}
int32_t main() {
  FlyingTuna();
  cin >> test;
  while (test--) Solve();
}
