

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

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