from math import ceil
b = input().split()
n = int(b[0])
k = int(b[1])
a = input().split()
summa = 0
current = 0
for i in range(n):
    a[i] = int(a[i])
if n == 1:
    print(int(ceil(a[0]/k)))
else:
    for i in range(n-1):
        if a[i] >= k:
            bags = a[i] // k
            summa += bags
            a[i] -= bags *k
        else:
            if current > 0:
                summa += 1
                a[i] = 0
        current = a[i]
        if current > 0:
            a[i+1] += current
    print(int(summa + ceil(a[n-1] / k)))