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]
    elif k - a[i] <= a[i+1]:
        cnt += 1
        a[i + 1] -= max(0,(k - a[i]))
    else:
        cnt += 1 if a[i] else 0
cnt += math.ceil(a[-1]/k)
print(cnt)