line = input()

n, k = map(int,line.split(' '))

ins = map(int, input().split(' '))
result = 0
mod = 0
for x,i in enumerate(ins):
  div,mod = divmod(i+mod,k)
  result += div
  if mod > i:
    result += 1
    mod = 0
if mod > 0:
  result += 1
print(result)
