N = int(input()) j, num = 0, 0 while N > 0: if N < j * (j + 1) // 2: N = N - j * (j - 1) // 2 j = 0 num += 1 else: j += 1 print(num)