#include <bits/stdc++.h>
using namespace std;
long long solve(long long n) {
  long long sum = 2 + (n / 2) * 4,
            prev = floor(sqrt(n * n - (long long)(n / 2) * (n / 2)));
  for (int i = n / 2 + 1; i <= n - 1; i++) {
    int x = floor(sqrt(n * n - (long long)i * i));
    if (prev - x > 1) {
      sum = sum + 4 * (prev - x);
    } else {
      sum = sum + 4;
    }
    prev = x;
  }
  sum += (prev - 1) * 4;
  sum += 2;
  return sum;
}
int main() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << "1\n";
  } else if (n == 1) {
    cout << "4\n";
  } else if (n == 2) {
    cout << "8\n";
  } else
    cout << solve(n) << endl;
  return 0;
}
