nandk=[int(x) for x in input().split()]
n=nandk[0]
k=nandk[1]
garbages=[int(x) for x in input().split()]
output=0
if garbages[0] % k == 0:
    output += garbages[0] // k
elif garbages[0] > k:
    output += garbages[0] // k + 1
else:
    output += 1
if garbages[0]%k>0:
    left=k-garbages[0]%k
else:
    left=0
for i in range(1,n):
    true=garbages[i]-left
    if true<0:
        left=0
        pass
    else:
        if true%k==0:
            output+=true//k
            left=0
        elif true>k:
            output+=true//k+1
            left=k-true%k
        else:
            output+=1
            left=k-true
print(output)