#include <bits/stdc++.h>
using namespace std;
int n;
void init() {
  scanf("%d", &n);
  if (n == 0) {
    printf("1\n");
    return;
  }
  int x = n * sqrt(double(2));
  cout << x * 4;
  return;
}
int main() {
  init();
  return 0;
}
