#include <bits/stdc++.h>
using namespace std;
bool vis[40001111];
int main() {
  int n;
  cin >> n;
  if (n == 0) {
    cout << 1 << endl;
    return 0;
  }
  cout << 4 * ((int)(sqrt(2) * n)) << endl;
  return 0;
}
