#include <bits/stdc++.h>
using namespace std;
int main() {
  long long r;
  cin >> r;
  long long a = 0;
  for (long long x = 1; x <= r - 1; x++) {
    long long y = sqrt(r * r - x * x);
    if ((x + 1) * (x + 1) + y * y > r * r) a++;
  }
  cout << (r == 0 ? 1 : 4 * (2 * r - 1 - a)) << endl;
}
