n,k = map(int,input().split())
t = list(map(int,input().split()))
t_bool = []
for x in range(0,len(t),+1):
    t_bool.append(False)
wyn = 0
r = 0
przel = False
for x in range(0,len(t),+1):
    if t_bool[x]==True:
        if t[x]!=0:
            wyn+=1
        t[x] -= k
        if t[x]<0:
            t[x]=0
    wyn += int(t[x]/k)
    if t[x]%k!=0:
        if x!=len(t)-1:
            t[x+1]+=t[x]%k
            t_bool[x+1]=True
        else:
            wyn+=1
print(wyn)