v = []
n,k = map(int, input().split())
s = 0
v = [int(x) for x in input().split()]
q = 0
carry = 0
for i in range(len(v)):
    garbage = v[i] + carry
    if i > 0 and 0 < garbage < k:
        carry = 0
        boxes = 1
    else:
        boxes = garbage // k
        carry = garbage % k
    q += boxes
if carry > 0:
    q += 1
print(q)
