#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef pair pll; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } ll n; bool cond(ll x){ return x * x > n; } // condを満たす最小のxを求める(lower_bound) // 全てのxが条件を満たさない場合はnを返す(nはとりえない値) ll lower_bound_cond(){ ll lb = -1, ub = n; while(ub - lb > 1){ ll mid = (lb + ub) / 2; if(cond(mid)) ub = mid; // Answer is in (lb, mid] else lb = mid; // Answer is in (mid, ub] } // now lb + 1 = ub return ub; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n; if(n <= 10){ set st; for(ll i = 1; i <= n; i++) st.insert(n / i); cout << st.size() << endl; exit(0); } ll x = lower_bound_cond(); cout << x + n / x - 1 << endl; }