#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e7 + 5;
bool cnt[maxn];
int main() {
  unsigned long long ans = 0, n;
  cin >> n;
  if (n == 0) {
    printf("%d\n", 1);
    return 0;
  }
  for (unsigned long long i = 0; i < n; i++) {
    unsigned long long y = sqrt(n * n - i * i);
    unsigned long long x = sqrt(n * n - y * y);
    if (x <= i) cnt[i] = true;
    ans++;
  }
  for (int i = 0; i < n; i++)
    if (!cnt[i]) {
      ans++;
    }
  cout << ans * 4 << endl;
  return 0;
}
