n, k = map(int, input().split())
A = [int(a) for a in input().split()]
cnt = 0
carry = 0
aux = 0
# cnt: Number of bags
# aux: we can drop it the next day.
# carry: we need to drop it today.
for i in range(n):
    if carry > 0:
        if A[i] + carry >= k:
            cnt += 1
            A[i] -= (k - carry)
            carry = 0
            if A[i] >= k:
                cnt += A[i] // k
                aux = A[i] % k
            else:
                aux = A[i]
            carry = aux
        else:
            cnt += 1
            carry = 0
            aux = 0
    else:
        if A[i] >= k:
            cnt += A[i] // k
            aux = A[i] % k
        else:
            aux = A[i]
        carry = aux
if carry > 0:
    cnt += 1
print(cnt)