#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline bool mina(A &x, B y) {
  return (x > y) ? (x = y, 1) : 0;
}
template <typename A, typename B>
inline bool maxa(A &x, B y) {
  return (x < y) ? (x = y, 1) : 0;
}
long long N;
int main() {
  cin >> N;
  int sol = 0;
  long long n = 0, a = 2;
  for (int _b = (1e6), i = (1); i < _b; ++i) {
    n += a;
    a += 3;
    if (n <= N && (N - n) % 3 == 0) ++sol;
  }
  cout << sol << endl;
  return 0;
}
