#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smax(T &x, T y) {
  x = max((x), (y));
}
template <class T>
inline void smin(T &x, T y) {
  x = min((x), (y));
}
const int MOD = 1e9 + 7;
const int SIZE = 2 * 1e5 + 10;
const int INF = 0x3f3f3f3f;
int n;
long long getadd(long long x) {
  long long a, b;
  a = x;
  b = -1;
  long long prev = b;
  long long ans = 0;
  while (a >= 0) {
    while ((b + 1) * (b + 1) + a * a <= x * x) {
      b++;
      ans++;
    }
    if (prev == b) ans++;
    prev = b;
    a--;
  }
  return ans - 2;
}
int main() {
  if (0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  while (scanf("%d", &(n)) == 1) {
    long long ans;
    if (n == 0)
      ans = 1;
    else if (n == 1)
      ans = 4;
    else {
      ans = 4;
      long long add = getadd(n);
      ans += add * 4LL;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
