n,k=map(int,input().split())
a=[*map(int,input().split())]
res,rest=0,0
for i,x in enumerate(a):
    if rest==0:
        rest=x%k
        res+=x//k
    else:
        item=min(k-rest,x)
        x-=item
        res+=x//k+1
        rest=x%k
if rest!=0:res+=1
print(res)