n,k=map(int,input().split())
l=list(map(int,input().split()))+[0]*int(n%2/n)

p=1
r=0
l[1]+=l[0]
old=[l[0]]
while p < n-1:
    t=l[p]//k
    old_index=p-1
    if t*k >= old[old_index]:
        t2=l[p]%k
        l[p+1]+=t2
        r+=t
        p+=1
        old.append(t2)
    else:
        eski=old[old_index]
        tt=eski//k
        r+=t
        if eski % k !=0:
            r+=1
        l[p]-=min(k,l[p])
        l[p+1]+=l[p]
        old.append(l[p])
        p+=1
r+=l[-1]//k
if l[-1] % k !=0:
    print(r+1)
else:
    print(r)
