N, K = map(int, input().split())
A = list(map(int, input().split()))
pre = A[0]
cnt = 0
for i in range(1, N):
    cnt += pre // K + int(pre % K != 0)
    pre = max(0, A[i] - (K - pre % K) * int(pre % K != 0))

cnt += pre // K + int(pre % K != 0)
print(cnt)