# NTFS: pajenegod
n,k = map(int,input().split())
lis = list(map(int,input().split()))
ans = 0
for i in range(n):      # Iterate over all days
	ans += lis[i]//k    # calculate bags required
	rem = lis[i]%k      # if still some bags remain
	lis[i] = rem
	if rem:
		ans += 1        # then we need a extra bag for this
		if i>=n-1:
			break
		lis[i+1] = max(0,lis[i+1]-(k-rem))  # since we are taking extra bag we can put some extra amount from next bag
print(ans)
		
