from sys import stdin,stdout
from math import gcd,sqrt
from collections import deque
input=stdin.readline
R=lambda:map(int,input().split())
I=lambda:int(input())
S=lambda:input().rstrip('\n')
L=lambda:list(R())
P=lambda x:stdout.write(x)
hg=lambda x,y:((y+x-1)//x)*x
pw=lambda x:1 if x==1 else 1+pw(x//2)
chk=lambda x:chk(x//2) if not x%2 else True if x==1 else False
N=10**(-6)
n,k=R()
flg=False
stk=0
ans=0
for i in R():
	stk+=i
	mn=0
	if flg:mn=1
	p=max(mn,stk//k)
	stk-=p*k
	ans+=p
	stk=max(0,stk)
	if stk:flg=True
	else:flg=False
if flg:ans+=1
print(ans)	