n,k = map(int,input().split())
mas = list(map(int,input().split()))
q,res,w = 0,0,0
for i in range(n):
    if q>=n:
        break
    a = mas[q]+w
    x,y = a//k,a%k
    if y==0:
        res+=x
        q+=1
        w=0
    else:
        if q==n-1:
            res+=x+1
            q+=1
        else:
            p=mas[q+1]
            c = a+p
            if c%k<=p:
                res+=c//k
                w=c%k
            else:
                res+=c//k+1
                w=0
            q+=2
print(res)