#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(NULL);
  cout << (fixed) << setprecision(6);
  long long n;
  while (cin >> n) {
    if (n == 0) {
      cout << 1 << endl;
      continue;
    }
    long long x = 0;
    int res = 1;
    for (long long y = n - 1; y >= 1; --y) {
      long long lastx = x;
      while (y * y + (x + 1) * (x + 1) <= n * n) {
        ++x;
      }
      res += max(x - lastx, 1LL);
    }
    cout << 4 * res << endl;
  }
  return 0;
}
