n,k = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
mlft = 0
ans = 0
for i in range(n):
	mtoday = (mlft + a[i]) // k
	if mlft > 0 and mtoday == 0:
		mlft = 0
		mtoday += 1
	else:
		mlft = (mlft + a[i]) % k
	ans += mtoday
if mlft > 0:
	ans += 1
print(ans)