#include <bits/stdc++.h>
int n;
int main() {
  scanf("%d", &n);
  if (n == 0) {
    puts("1");
    return 0;
  }
  long long ans = 0;
  int prev = n;
  for (int i = 1; i <= n; ++i) {
    int k = sqrt(pow(n, 2.0) - pow(i, 2.0));
    ans += std::max(prev - k, 1);
    prev = k;
  }
  printf("%lld\n", ans * 4ll);
  return 0;
}
