#include <bits/stdc++.h>
using namespace std;
long long R;
int main() {
  scanf("%I64d", &R);
  if (!R) return printf("1\n"), 0;
  long long oldx = 0, ret = 0, S = 0;
  for (long long y = -R; y <= 0; y++) {
    while (S * S <= R * R - y * y) S++;
    long long x = S;
    if (y > -R) ret += max(1ll, (x - oldx)) * 2;
    oldx = x;
  }
  ret *= 2;
  printf("%I64d\n", ret);
}
