#include using namespace std; int main() { long long n; cin >> n; long long left = 0; long long right = n + 1; while (right - left > 1) { long long mid = (right + left) / 2; long long d = n / mid; if (mid >= d) { right = mid; } else { left = mid; } } long long ans = right - 1 + n / right; cout << ans << '\n'; return 0; }