#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e7 + 5;
const int mod = 1e9 + 7;
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool ok[maxn];
int main() {
  long long n;
  cin >> n;
  if (n == 0) {
    puts("1");
    return 0;
  }
  long long ret = 0;
  for (long long i = 0; i < n; i++) {
    long long y = sqrt(n * n - i * i);
    long long x = sqrt(n * n - y * y);
    if (x <= i) ok[i] = true;
    ret++;
  }
  for (long long i = 0; i < n; i++)
    if (!ok[i]) ret++;
  cout << ret * 4 << endl;
  return 0;
}
