#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const double eps = 1e-9;
int main() {
  std::ios_base::sync_with_stdio(false);
  long long n, ret = 4;
  cin >> n;
  if (!n) {
    cout << 1 << endl;
    return 0;
  }
  long long x = n - 1, y = 1;
  while (x >= y) {
    if (x == y) {
      if (x * x + y * y <= n * n) ret += 4;
      break;
    } else if (x * x + y * y <= n * n)
      ret += 8, y++;
    else
      x--;
  }
  cout << ret << endl;
  return 0;
}
