import math

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

    bags = 0
    current = 0
    count = 0

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

Garbage()