n,m=map(int,input().split())
l=list(map(int,input().split()))
cnt=d=mod=0
for i in range(n):
    if l[i]==0:
        l[i]+=mod
        d=l[i]//m
        if l[i]%m!=0:
            d+=1
        mod=0
        cnt+=d
    else:
        l[i]+=mod
        d=l[i]//m
        mod=l[i]%m
        if i==n-1 and l[i]%m!=0:
            d+=1
            mod=0
        cnt+=d
print(cnt)
