n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
left = -1
for i in range(n):
    if i == 0 and i < n - 1:
        ans += a[i] // k
        a[i + 1] += a[i] % k
        left = a[i] % k
    elif i < n - 1:
        if a[i] < k:
            ans += (left + k - 1) // k
            a[i] -= left
            ans += a[i] // k
            a[i + 1] += a[i] % k
            left = a[i] % k
        else:
            ans += a[i] // k
            a[i + 1] += a[i] % k
            left = a[i] % k
    else:
        ans += (a[i] + k - 1) // k

print(ans)