from math import ceil


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

prev = 0
ans = 0
for x in a:
    ans += ceil(prev / k)
    prev = max(0, x - prev % k)

print(ans + ceil(prev / k))