n, k = map(int, input().split())
a = [int(x) for x in input().split()]

bags, capacity = 0, 0

for i in range(n):
    x = a[i] + capacity
    if not x:
        continue
    elif x < k and capacity > 0:
        bags += 1
        capacity = 0
    else:
        bags += (x // k)
        capacity = (x % k)
print(bags)