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 nremain = n - cval(kmax) kval = kmax while nremain > 0: if cval(kval) <= nremain: nremain -= cval(kval) cnum += 1 else: kval -= 1 print(cnum)