#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384626;
const long long mod = 1000000007;
void solve() {
  long long n;
  cin >> n;
  if (n == 0) {
    cout << "1\n";
    return;
  }
  long long L = sqrt(n * n / 2);
  long long ans = 8 * L + 4;
  long long x = L + 1, y = L;
  if (x * x + y * y > n * n) ans -= 4;
  cout << ans << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t = 1;
  while (t--) solve();
  return 0;
}
