import sys,math,collections;sys.setrecursionlimit(10**7) from operator import itemgetter def Is(): return [int(x) for x in sys.stdin.readline().split()] def Ss(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def S(): return input() def tri(n): return (math.sqrt(1+8*n)-1)//2 n = I() ans = 0 while n: t = tri(n) ans += 1 n -= (t*(t+1))/2 print(ans)