import sys

n, k = map(int, sys.stdin.readline().split())
arr = list(map(int, sys.stdin.readline().split()))
ans = 0
temp = 0
for i in range(n):
    if not arr[i]:
        ans += temp // k if temp % k == 0 else temp // k + 1
        temp %= k
    else:
        temp += arr[i]
ans += temp // k if temp % k == 0 else temp // k + 1
print(ans)