#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  if (n == 0)
    cout << 1 << endl;
  else {
    long long sum = 0;
    long long y = 0;
    for (long long i = n; i > 0; i--) {
      long long j = sqrt((n * n - i * i));
      sum += j == y ? 1 : j - y;
      y = j;
    }
    sum = sum * 4;
    cout << sum << endl;
  }
  return 0;
}
