n, k = map(int, input().split())
l = list(map(int, input().split()))

ans = 0
bal = 0
for i in range(n):
	if (l[i] + bal) % k > l[i]:
		ans += (l[i] + bal) // k
		bal = 0
		ans += 1
	else:
		ans += (l[i] + bal) // k
		bal = (l[i] + bal) % k

if bal > 0:
	ans += 1

print(ans)
