import math

def Garbage():
    n,k = map(int,raw_input().split())
    units_garbage = raw_input().split()

    bags = 0
    current = 0

    for i in range(n):
        if i != n-1:
            if int(units_garbage[i]) == 0:
               bags += math.ceil(float(int(units_garbage[i])+current)/k) 
               current = 0
            else:
                bags += (int(units_garbage[i])+current)/k
                current = (int(units_garbage[i])+current)%k
        else:
            bags += math.ceil(float(int(units_garbage[i])+current)/k)
        #print bags,current
    print int(bags)

Garbage()