from math import ceil
n, k = map(int, input().split())
A = list(map(int, input().split()))
ans, t, d = 0, 0, 0
for i in range(n):
    if d == 2 and tt < k:
        t = 0
        ans += 1
        d = 0
    d += 1
    tt = t + A[i]
    t = tt % k
    ans += tt//k
    A[i] = 0
print(ans + ceil(t/k))