#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main ()
{
    int t;
    cin >> t;
    while (t --)
    {
        int s;
        cin >> s;
        int two = 2, ans = 0;
        int s2 = s, ans2 = 0, three = 3;
        s -= 1;
        ans ++;
        while (s > 0)
        {
            s -= two;
            two += 2;
            ans ++;
        }
        s2 -= 1;
        ans2 ++;
        while (s2 > 0)
        {
            s2 -= three;
            three += 2;
            ans2 ++;
        }
        cout << min (ans, ans2) << endl;
    }
}