n,k = map(int, raw_input().split(' '))
aas = map(int, raw_input().split(' '))

counter = 0
# assume n>1
# throw no garbage on the first day; leave it for the next day
old_garbage = aas[0]

for i in range(1, len(aas)):
	garbage_today = aas[i]
	
	# first throw all the old garbage
	# begin by throwing filled bags
	counter += old_garbage // k
	# now we can throw up to one more bag
	if old_garbage % k != 0 and old_garbage > 0:
		counter += 1
		garbage_today -= old_garbage % k

	# now leave the rest of the garbage for tomorrow
	old_garbage = max(garbage_today, 0)

# it's the end of the last day. is any garbage remaining?
if old_garbage > 0:
	counter += old_garbage // k
	# might be one more bag remaining
	if old_garbage % k != 0:
		counter += 1

print counter