import math
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))
s,f = 0,0
for i in range(n-1):
    t1,t2 = a[i]//k,a[i]%k
    if t1:
        s+=t1
        if t2:
            a[i+1]+=t2
            f=1
        else:
            f=0
    elif f:
        s+=1
        f=0
    else:
        a[i+1]+=a[i]
        f=1
s+=math.ceil(a[-1]/k)
print(s)