import math
n,k=map(int,input().split(" "))
plan=list(input().split())
plan=[int(x) for x in plan]
count=0
temp=0
for i in range(len(plan)):
    if i==len(plan)-1 and temp!=0:
        plan[i] -= (k - temp)
        if plan[i]<0:
            plan[i]=0
        count+=1
        if plan[i]%k==0:
            count+=plan[i]/k
            break
        else:
            count+=int(plan[i]/k)+1
            break
    elif i==len(plan)-1 and temp==0:
        count+=math.ceil(plan[i]/k)
        break
    if plan[i]%k!=0 and temp==0:
        count+=int(plan[i]/k)
        temp=plan[i]%k
    elif plan[i]%k!=0 and temp!=0:
        plan[i]-=(k-temp)
        if plan[i]<0:
            plan[i]=0
            count+=1
            continue
        count+=int(plan[i]/k)
        count+=1
        if plan[i]%k!=0:
            temp=plan[i]%k
        else:
            temp=0
    elif plan[i]%k==0:
        plan[i]-=(k-temp)
        if plan[i]<0:
            plan[i]=0
            count+=1
            continue
        count+=int(plan[i]/k)
        count+=1
        if plan[i]%k!=0:
            temp=plan[i]%k
        else:
            temp=0
print(int(count))