#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
long long sub(long long a, long long b) {
  return (a % mod - b % mod + mod) % mod;
}
long long mul(long long a, long long b) { return (a % mod * b % mod) % mod; }
long long power(long long a, long long b, long long MOD) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= MOD;
    }
    a = a * a;
    a %= MOD;
    b >>= 1;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  if (n == 0) {
    cout << 1 << '\n';
    return 0;
  }
  cout << (long long)4 * (long long)floorl(n * sqrtl(2)) << '\n';
}
