#include <bits/stdc++.h>
using namespace std;
long long n, ans = 0, used = 0;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i < 1e7; i++) {
    used += 2 * i + i - 1;
    if (n >= used && (n - used) % 3 == 0) ans++;
  }
  cout << ans;
  return 0;
}
