n,k=map(int,input().split())
a=list(map(int,input().split()))

space=0
bag=0
for i in a:
    if space:
        if i>=space:
            i-=space
            space=0
        else:
            space=0
            i=0
    b=i//k
    rem=i%k
    if space==0:
        bag+=b
        if rem:
            bag+=1
            space=k-rem

print(bag)
        