n , k = map(int, input().split())
l = list(map(int,input().split()))
s = 0
for i in range(n-1):
    x = l[i]
    s+=x//k
    if x%k > 0:
        l[i+1] += x%k
        if 0 < l[i+1] < k:
            l[i+1] = 0
            s += 1
s+=l[-1]//k + (l[-1]/k != l[-1]//k)
print(s)
