n, k = map(int, input().split())
s = list(map(int, input().split()))
ost = s[0]
c = 0
for el in s[1:]:
    now = ost + el
    c += now // k
    if now // k * k >= ost:
        ost = now % k
    else:
        now = now % k
        vibros = now // k * k
        ostvibros = ost - vibros
        if ostvibros / k > ostvibros // k:
            np = ostvibros // k + 1
        else:
            np = ostvibros // k
        c += np
        vibros = np * k
        if vibros > now:
            ost = 0
        else:
            ost = now - vibros
if ost:
    if ost // k == ost / k:
        c += ost//k
    else:
        c += ost // k + 1
print(c)
