#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
long long __pow(long long x, long long y, long long m) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % m;
    y >>= 1;
    x = (x * x) % m;
  }
  return res % m;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
const long long N = 100, inf = 1e18, M = 998244353;
long long test, n, m, k, x, ans, query, fact[N];
vector<long long> g[N];
void solve(long long tst) {
  cin >> n;
  long long ans = 0;
  x = 1;
  while ((n - x - 1) / x > x) {
    x++;
    ans++;
  }
  cout << ans + (n - x - 1) / x + 1 << endl;
}
int32_t main() {
  test = 1;
  cin >> test;
  for (long long i = 1; i <= test; i++) {
    solve(i);
  }
  return 0;
}
