# problem D
n,k = map(int, raw_input().split(' '))
aas = map(int, raw_input().split(' '))
#n,k = 5, 1
#aas = [1000000000, 1000000000, 1000000000, 1000000000, 1000000000]

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

aas.append(0)
n = n + 1;

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