#include using namespace std; using int64 = long long; int main() { int N; cin >> N; vector< int > vs; for(int i = 1; i * (i + 1) / 2 <= N; i++) { vs.push_back(i * (i + 1) / 2); } int ret = 0; while(N > 0) { int last = 0; for(auto &p : vs) { if(N >= p) last = p; } N -= last; ++ret; } cout << ret << endl; }