_, capacity = map(int, raw_input().split())
a = map(int, raw_input().split())
ret = 0
fromPrev = 0
for g in a:
    if fromPrev:
        ret += 1
        g -= min(capacity - fromPrev, g)
    ret += g / capacity
    fromPrev = g % capacity
print ret + (fromPrev > 0)