n, k = map(int, input().split())
values = list(map(int, input().split()))
bags = 0
r = 0
for i, val in enumerate(values):
    #print(i,val,bags,leftover)
    x = val + r
    if x == 0:
        continue
    elif x < k and r > 0:
        r = 0
        bags += 1
    else:
        bags += x // k
        r = x % k

if r > 0:
    bags += 1

print(bags)