n, k = map(int, input().split())
a = list(map(int, input().split()))
 
ans, left = 0, 0
for i in range(n):
    if i < n - 1:
        use = (left + k - 1) // k
        ans += use
        left += a[i]
        left = max(0, left - use * k)
    else:
        ans += (left + k - 1) // k
 
print(ans)