#include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { ll n;cin >> n; ll l = -1, r = 1000000000; while(r - l > 1) { ll mid = l + (r - l) / 2; if (n <= mid * (mid + 1)) { r = mid; } else { l = mid; } } cout << n / r + r - 1 << endl; return 0; }