#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1.0);
const long long int mod = 1e9 + 7;
const int MAXN = 1e6 + 5;
void cp() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << 1 << '\n';
    return;
  }
  long long int ans = 1;
  int prev = n;
  for (int i = 1; i <= n; i++) {
    int pos = sqrt(n * 1LL * n - i * 1LL * i);
    ans += max(0, prev - pos - 1);
    ans++;
    prev = pos;
  }
  ans = (ans - 1) * 4;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    cp();
  }
  return 0;
}
