#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
long long n;
bool dist(long long x, long long y) {
  if (n * n >= x * x + y * y)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (!n) {
    cout << 1;
    return 0;
  }
  long long x = 0, px = 0, ans = 4, qua = 0;
  for (int y = n - 1; y > 0; --y) {
    while (dist(x, y)) {
      ++x;
    }
    --x;
    qua += max(x - px, 1LL);
    px = x;
  }
  ans += 4 * qua;
  cout << ans;
  return 0;
}
