import sys input = sys.stdin.readline N=int(input()) A=[k*(k+1)//2 for k in range(1,10**5)] ANS=0 for i in range(len(A)-1,-1,-1): if N>=A[i]: N-=A[i] ANS+=1 print(ANS)