import sys
input = sys.stdin.readline

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

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

print(ans)