MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n,k=f()
l=[0]+il()+[0]
ans=0
x=0
for i in range(1,n+2):
    ans+=(l[i-1]+l[i])//k
    if l[i]>=(l[i-1]+l[i])%k:
        l[i]=(l[i-1]+l[i])%k
    else:
        ans+=1
        l[i]=max(0,l[i]-k+l[i-1])
print(ans)