from sys import stdin,stdout
def main():
    ans=0
    n,k=map(int,stdin.readline().split( ))
    a=list(map(int,stdin.readline().split( )))
    
    if n==1:
        if a[0]==0:
            ans=0
        elif a[0]<=k:
            ans=1
        elif a[0]%k:
            ans=a[0]//k+1
        else:
            ans=a[0]//k
        stdout.write("%d\n"%(ans))
        return 
        
    m=a[0]
    ans=0
    for i in range(1,n):
        if i==n-1:
            x=m+a[i]
            if x<=k:
                ans+=1
            elif x%k:
                ans+=x//k+1
            else:
                ans+=x//k
        else:
        
            x=m+a[i]
            if x<k:
                y=1
                z=0
            else:
                y=x//k
                z=x%k
            ans+=y
            m=z
    stdout.write("%d\n"%(ans))
main()
        