import sys
def fi():
	return sys.stdin.readline()
if __name__ == '__main__':
	n,k = map(int, fi().split())
	l = list(map(int, fi().split()))
	prev = 0
	c = 0
	for i in range (n):
		curr = 0
		if prev and i != 0:
			if prev >= k:
				c+=prev//k
		curr = prev%k
		if l[i] >= k-curr :
			c+=1
			prev = l[i]-k+curr
		elif l[i] < k-curr and i != 0 and curr!=0:
			c+=1
			prev = 0
		else:
			prev = l[i]
	if prev > 0:
		if prev %k == 0:
			c+=prev//k
		else:
			c+= (prev//k)+1
	print(c)