#include using namespace std; vector init (int n) { vector r; int a = 0; int k = 1; while (a <= n) { a = k * (k + 1) / 2; r.emplace_back(a); k += 1; } return r; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; int ans = 0; cin >> N; vector v = init(N); int p = v.size() - 1; while (N > 0) { if (N >= v[p]) { ans += N / v[p]; N %= v[p]; } p -= 1; } cout << ans << endl; return 0; }