n, k = tuple(int(_) for _ in input().split())
a = tuple(int(_) for _ in input().split())

sum0, sub_sum = 0, 0
for index, garbage in enumerate(a):
    sub_sum += garbage
    if garbage == 0 or index == len(a) - 1:
        if sub_sum % k == 0:
            sum0 += sub_sum / k
        else:
            sum0 += int(sub_sum / k) + 1
        sub_sum = 0

print(int(sum0))
