#python3
import math
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
k=0
if a[1]==1 and b[0]==1:
    print(1)
    quit()
while i<a[0]-1:
    if (b[i]+b[i+1])%a[1]==0:
        k+=(b[i]+b[i+1])/a[1]
        b[i+1]=0
    else:
        if (b[i]+b[i+1])<a[1]:
            k=k+1
        else:
            if (b[i]+b[i+1])%a[1]<=b[i+1]:
                k+=math.ceil(((b[i]+b[i+1])-((b[i]+b[i+1])%a[1]))/a[1])
                b[i+1]=(b[i]+b[i+1])%a[1]
            else:
                k+=math.ceil(b[i]+b[i+1]/a[1])
    i+=1
print(int(k))