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

ra = a[::-1]

bags = 0
cur_capacity = 0
for i in range(n):
    if ra[i]:
        bags += max(((ra[i] - cur_capacity) // k), 1)
    cur_capacity = (k - ra[i] // k) % k

print(bags)
