from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log, pi, e, asin,acos, cos, sin, floor
from itertools import *
from fractions import Fraction
import string
import copy
import random
import bisect
from decimal import *
from collections import deque
from sys import *
digs = string.digits + string.ascii_letters

def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).strip().split())


n,k=mp()
l=list(mp())
ans=0
pre=0
for i in range(n):
	if i==n-1:
		ans+=((l[i]+pre-1)/k+1)
	elif i!=0:
		if l[i]+pre < k and pre!=0:
			ans+=1
			pre=0
		else:
			l[i]+=pre
			ans+=l[i]/k
			l[i]=l[i]%k
			pre=l[i]
	else:
		ans+=l[i]/k
		l[i]=l[i]%k
		pre=l[i]
print ans

