#include <bits/stdc++.h>
using namespace std;
const int maxn = 2020;
const int maxx = 10000;
const int MOd = 1e9 + 7;
int a;
bool f(int x, int y) {
  return (long long)x * x + (long long)y * y <= (long long)a * a;
}
int main() {
  scanf("%d", &a);
  if (a == 0) {
    printf("1\n");
    return 0;
  }
  int x = 0;
  int y = a - 1;
  int k = 0;
  while (y >= 0) {
    if (!f(x + 1, y) || !f(x, y + 1)) k++;
    if (f(x + 1, y)) {
      x++;
      continue;
    }
    y--;
  }
  cout << 4 * k << endl;
  return 0;
}
