#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long i = n, j = 0;
  if (n == 0) {
    cout << 1 << endl;
    return 0;
  }
  long long ans = 0;
  while (i > 0) {
    long long t = j;
    while (i * i + j * j <= n * n) j++;
    j--;
    if (t - j == 0)
      ans++;
    else
      ans += j - t;
    i--;
  }
  cout << ans * 4 << endl;
  return 0;
}
