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

counter = 0

# throw no garbage on the first day; leave it for the next day
old_garbage = aas[0]

for garbage_today in aas[1:] + [0]:
	# 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 -= (k - (old_garbage % k))

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


print counter