n,k=map(int,input().split())
a=list(map(int,input().split()))
bag=0
carry=0
for i in a:
    if carry==0:
        carry=i
        continue
    bag+=-(-carry//k)
    if carry>=k:
        remain=carry%k
    else:
        remain=k-carry%k
    if remain>=i:
        carry=0
    else:
        carry=i-remain

bag+=-(-carry//k)
print(bag)
        