n,k=map(int,input().split())
a=list(map(int,input().split()))
l=0
for i in range(len(a)-1):
    if(a[i]+a[i+1]>=k):
        l+=(a[i]+a[i+1])//k
        a[i+1]=(a[i]+a[i+1])%k
    else:
        l+=1
        a[i+1]==0
if(a[-1]>=k):
    l+=a[-1]//k
else:
    l+=1
print(l-1)
    
