import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
 
MOD = 1000000007
 
I = lambda : int(input())
M = lambda : map(int, input().split())
Ms = lambda : map(str, input().split()) 
ARR = lambda : list(map(int, input().split()))
 
def solve():
	n, k = M()
	garbadges = ARR()

	bags = 0
	i = 0
	while i<n:
		if garbadges[i] >= k:
			bags += (garbadges[i]//k)
			garbadges[i] -= (garbadges[i]//k) * k
		elif garbadges[i] < k and garbadges[i] > 0:
			bags += 1
			if i+1 < n:
				garbadges[i+1] -= (k-garbadges[i])
		i += 1
	
	print(bags)

tc = 1
# tc = I()
for _ in range(tc):
	solve()