#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
void fun() {
  long long i, j, ans;
  for (i = 1; i <= 1000009; i++) {
    ans = i * i;
    v.push_back(ans);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  fun();
  long long a, b, c, i, ok = 0, pos, res, ans;
  cin >> a;
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) {
    if (v[i] >= a) {
      pos = i + 1;
      res = v[i];
      break;
    }
  }
  ok = (pos - 1) * 2;
  ans = ok - (abs(res - a) / pos);
  cout << ans << endl;
  return 0;
}
