import math def cval(k): return k*(k+1)/2 n = int(input()) kmax = math.floor((math.sqrt(1+8*n)-1)/2) cnum = 1 ctmp = 10**100 - 1 kval = kmax nremain = n - cval(kmax) while nremain > 0: if cval(kval) <= nremain and ctmp > 0: nremain -= cval(kval) cnum += 1 ctmp -= 1 else: kval -= 1 ctmp = 10**100 print(cnum)