#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int gcd(int a, int b) {
  while (a > 0 && b > 0)
    if (a > b)
      a %= b;
    else
      b %= a;
  return a + b;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
long long n, ans, temp;
int main() {
  cin >> n;
  if (n == 0)
    ans = 1;
  else {
    temp = floor(sqrt(2 * n * n));
    ans = 4 * temp;
  }
  cout << ans << endl;
  return 0;
}
