import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
prev=0
c=0
for i in range(n):
    ans+=(prev+a[i])//k
    prev=(prev+a[i])%k
    if prev>a[i]:
        if prev%k==0:
            ans+=prev//k
        else:
            ans+=prev//k +1
        prev=0
if prev>0:
    ans+=1

print(ans)







