from sys import stdin,stdout
from math import ceil
def main():
    n,k=map(int,stdin.readline().split( ))
    a=list(map(int,stdin.readline().split( )))
    
    ans=0
    
    for i in range(1,n):
        
        s=a[i-1]+a[i]
        q=s//k
        ans+=q
        
        if q==0 and a[i-1]!=0:
            ans+=1
            a[i]=0
        else:
            a[i]=a[i]-(q*k-a[i-1])
    
    ans+=ceil(a[n-1]/k)
    stdout.write("%d\n"%(ans))
main()