n,k = map(int,input().split())
l = list(map(int,input().split()))+[0]
i = 0
s = 0
import math
ans = 0
while(i<n):
    s+=l[i]
    if(l[i]==0 or i==n-1):
        x = math.ceil(s/k)
        ans+=x
        y = x*k-l[i]
        l[i+1]-=y
        s = 0
    i+=1
print(ans)