#include <bits/stdc++.h>
using namespace std;
int res[2500];
int main() {
  memset(res, -1, sizeof(res));
  res[1] = 1;
  for (int i = 4; i < 50; i += 2) {
    int t = (i - 2) / 2;
    int m;
    if (t % 2)
      m = (t * t + 1) / 2;
    else
      m = t * t / 2;
    for (int r = 4; r <= m * 4; r += 4) {
      if (res[r] == -1 || res[r] > i) res[r] = i;
    }
  }
  for (int i = 5; i < 50; i += 4) {
    int p = (i - 1) / 2;
    int p1 = (p * p) / 2;
    int p2 = p;
    for (int x = 0; x <= p1; x++)
      for (int y = 0; y <= p2; y++)
        for (int z = 0; z <= 1; z++) {
          int r = x * 4 + y * 2 + z;
          if (res[r] == -1 || res[r] > i) res[r] = i;
        }
  }
  for (int i = 3; i < 50; i += 4) {
    int p = (i - 1) / 2;
    int p1 = (p * p + 1) / 2;
    int p2 = (p - 1);
    for (int x = 0; x <= p1; x++)
      for (int y = 0; y <= p2; y++) {
        int r = x * 4 + y * 2 + 1;
        if (res[r] == -1 || res[r] > i) res[r] = i;
        r = x * 4 + y * 2 + 0;
        if (res[r] == -1 || res[r] > i) res[r] = i;
      }
    p1 = (p * p - 1) / 2;
    p2 = (p + 1);
    for (int x = 0; x <= p1; x++)
      for (int y = 0; y <= p2; y++) {
        int r = x * 4 + y * 2 + 0;
        if (res[r] == -1 || res[r] > i) res[r] = i;
      }
  }
  int x;
  cin >> x;
  cout << res[x] << endl;
  return 0;
}
