
n,k = map(int, raw_input().split(' '))
aas = map(int, raw_input().split(' '))

def ceil(a, b):
    'return ceil of a/b'
    return (a+b-1)/b

if n == 1:
    print (aas[0]+k-1)/k
else:
    n_bags = 0
    left = aas[0];
    for i in range(1,n):
        #need ceil(left/k) bags
        #ceil(left,k)
        n_bags += ceil(left,k)
        left = max(0, aas[i]-(k-ceil(left,k)));

    n_bags += ceil(left, k);
    print n_bags;
