n,k=map(int,input().split())
ans=0
l1=list(map(int,input().split()))
for i in range(n):
    if(l1[i]>k):
     p=(l1[i]-l1[i]%k)/k
     if(l1[i]%k!=0):
         p+=1
     ans+=p
     if(i<n-1):
         l1[i+1]-=p*k-l1[i]
    elif(k>=l1[i] and l1[i]>0):
        ans+=1
        if(i<n-1):
            l1[i+1]-=k-l1[i]
            
print(int(ans))