n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
c, x = 0, 0
for i in range(n):
    y = (x + a[i]) // k
    if x > 0 and y == 0:
        x = 0
        y += 1
    else:
        x = (x + a[i]) % k
    c += y
if x > 0:
    c += 1
print(c)