#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long y = n;
  long long sum = 0;
  for (long long x = 0; x < n; x++) {
    long long t = y;
    while (t * t + x * x > n * n) t--;
    sum += max(1ll, y - t);
    y = t;
  }
  if (y > 1) sum += y - 1;
  if (n > 0)
    cout << 4 * sum << endl;
  else
    cout << "1\n";
}
