#include <bits/stdc++.h>
using namespace std;
int n;
void read() { cin >> n; }
void work() {
  int sum = 0;
  long long preY = n;
  for (int x = 1; x < n; ++x) {
    if (preY * preY + 1LL * x * x <= 1LL * n * n)
      ++sum;
    else
      --preY;
    ++sum;
  }
  cout << (n == 0 ? 1 : sum * 4 + 4) << endl;
}
int main() {
  read();
  work();
  return 0;
}
