import sys

n, k = tuple(int(i) for i in sys.stdin.readline().split())
a = tuple(int(i) for i in sys.stdin.readline().split())
assert len(a) == n

bags = 0
r = 0
for ai in a:
    leftovers = (r > 0)
    q, r = divmod(ai + r, k)
    if q == 0:
        if leftovers:
            bags += 1
            r = 0
    else:
        bags += q
if r > 0:
    bags += 1
print(bags)
