from math import ceil
n,k = map(int, input().split())
a = [0] + list(map(int, input().split())) + [0]
bags = 0
for i in range(1, n + 2):
	bags+= a[i - 1] // k
	y = a[i - 1] % k
	if y > 0:
		bags+=1
		#a[i - 1] = 0
		a[i] = max(a[i] - (k - y), 0)
print(bags)