#include <bits/stdc++.h>
using namespace std;
bool is(double x) { return std::floor(x) == x; }
int main(void) {
  double a, b = 0, c = 0, d = 0, e = 0, g;
  int anc;
  cin >> a;
  g = 1;
  while (g < a) {
    b = g;
    c = a / g;
    if (!(is(c))) {
      if (e == 0 || b + c < d + e) {
        d = b;
        e = c;
      }
    }
    g += 1;
  }
  anc = d + e;
  cout << anc << endl;
  return 0;
}
