#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
const int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
long long cnt = 0, n;
int main() {
  cin >> n;
  if (n == 0) {
    cout << 1;
    return 0;
  }
  long long x = n, y = 0, dd[3] = {1, 5, 2};
  while (x >= 0) {
    cnt++;
    bool f = true;
    for (int i = 0; i < 3 && f; i++) {
      long long t =
          (x + dx[dd[i]]) * (x + dx[dd[i]]) + (y + dy[dd[i]]) * (y + dy[dd[i]]);
      if (t <= n * n && t > (n - 1) * (n - 1) && f) {
        x += dx[dd[i]];
        y += dy[dd[i]];
        f = false;
      }
    }
    if (f) break;
  }
  cout << (cnt - 2) * 4 + 4;
}
