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 j += 1 print(num)