blocks = int(input("Enter the number of blocks: "))

height = 0
inlayer = 1

while inlayer <= blocks:
    height =height+ 1
    blocks =blocks-inlayer
    inlayer = inlayer+ 1

print("The height of the pyramid:", height)
print("Остаток", blocks)

# blocks=6
# height=0
# inlayer=1

# height=1
# blocks=5
# inlayer=2

# height=2
# blocks=3
# inlayer=3

# height=3
# blocks=0
# inlayer=4


