import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
sumA = 0
yesterday = 0
for i in range(n):
    next = a[i] + yesterday
    bag = next//k
    sumA += bag
    if a[i] == 0  :
        if bag ==0 and next>0:
            sumA += 1
            yesterday = 0
    else:
        if bag ==0 and yesterday > 0:
            sumA += 1
            yesterday = 0
        else:
            yesterday = next % k
if yesterday>0:
    sumA+=1
print(sumA)