a,b=map(int,input().split())
s=0;p=0;y=0
for i in map(int,input().split()):
    if y:s+=1;y=0
    if p:
        if p+i>=b:
            k=i+p
            p=0
            r=k//b
            s+=r
            p=k-(r*b)
        else:y+=p;p=i
    else:
        k=i//b
        s+=k
        p=i-(k*b)
print(s+(p!=0))