import math
n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n - 1):
    cnt += a[i] // k
    a[i] %= k
    if i + 1 == n - 1:
        a[i + 1] += a[i]
    else:
        cnt += 1
        a[i + 1] -= max(0, (k - a[i]))
cnt += math.ceil(a[-1]/k)
print(cnt)
