#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (long i = 1; i <= n; i++) {
    for (long j = 1; j <= i; j++) {
      if (i * j == n) {
        cout << i + j << endl;
        break;
      }
    }
  }
  return 0;
}
