import math
n,k = list(map(int,input().split()))
a=list(map(int,input().split()))
curr_dump=0
prev_dump=0
n_disposal=0
for i in range(n):
    curr_dump=a[i]
    #n_disposal+=int(a[i]/k)
    if(prev_dump+curr_dump<k):
        if(prev_dump>0):
            n_disposal+=1
            prev_dump=0
        elif(prev_dump==0):
            prev_dump=curr_dump
        
    else:
        n_disposal+=int((prev_dump+curr_dump)/k)
        prev_dump=(prev_dump+curr_dump)%k
n_disposal+=math.ceil(prev_dump/k)
print(n_disposal)
