#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int N = 200;
int main() {
  long long n;
  cin >> n;
  long long y = 0;
  long long x = n;
  long long ans = 0;
  while (true) {
    if (x != 0 && y != 0)
      ans += 4;
    else if (x != 0)
      ans += 2;
    else if (y != 0)
      ans += 2;
    else
      ans++;
    if (y == n) break;
    if ((y + 1) * (y + 1) + x * x <= n * n) {
      y++;
      continue;
    }
    x--;
    while ((y + 1) * (y + 1) + x * x > n * n) {
      if (x != 0 && y != 0)
        ans += 4;
      else if (x != 0)
        ans += 2;
      else if (y != 0)
        ans += 2;
      else
        ans++;
      x--;
    }
    y++;
  }
  cout << ans;
  return 0;
}
