#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, c = 1, d = 2, v = 2;
  cin >> n;
  for (long i = 1; i <= n; i++) {
    if (v % 2 == 0) {
      i = i + c - 1;
      v = 1;
      d = d + 2;
    } else {
      v = 2;
      i = i + c - 1;
      c++;
      d = d + 2;
    }
  }
  cout << d;
}
