#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int M = 1e6 + 5, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    long long ans = 0;
    int pre = -1;
    for (int j = n; j >= 0; j--) {
      int l = pre, r = INF;
      int res = 0;
      while (l <= n && 1LL * l * l + 1LL * j * j <= 1LL * n * n) {
        res = l;
        l++;
      }
      ans += max(1, res - pre);
      pre = res;
    }
    if (n == 0)
      printf("1\n");
    else
      printf("%I64d\n", (ans - 2) * 4 + 4);
  }
  return 0;
}
