n, k = map(int, input().split())
a = list(map(int, input().split()))
b, r = 0, 0
for i in a:
    i += r
    n = i // k
    b += n
    if n == 0 and r != 0:
        b += 1
        r = 0
        continue
    r = i - n*k
if r != 0:
    b += 1
print(b)