#include <bits/stdc++.h>
int main() {
  long long n, h, k, s;
  scanf("%I64d", &n);
  h = 0;
  if ((n + 1) % 3 == 0) h++;
  s = 7;
  k = 5;
  for (s = 7; s <= n; s = s + k) {
    if ((n - s) % 3 == 0) h++;
    k = k + 3;
  }
  printf("%I64d\n", h);
  return 0;
}
