# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
from sys import stdin, stdout
from math import sqrt
import math
import heapq
from itertools import accumulate



#N = int(input())

#s = input() 
N,K = [int(x) for x in stdin.readline().split()]

arr = [int(x) for x in stdin.readline().split()]

last = 0

res = 0
for i in range(N):
    # must clean
    if last%K!=0:
        d = K - last%K
        remove = min(arr[i],d)
        last += remove
        arr[i] -= remove
    
    res += (last//K) + 1*(last%K!=0)
    # wait tomorrow
    
    res += (arr[i]//K)
    last = arr[i]%K
    
    
# if any left
res += (last//K) + 1*(last%K!=0)

print(res)
    


    
            