import sys, math
from sys import stdin, stdout

rem =10**9+7
inf=10**18
sys.setrecursionlimit(15)
#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().split())
from heapq import heappush,heappop,heapify
from collections import deque
from bisect import *









n,k=take()
arr=take()
ans=0
prev=0
ans=0
for i in range(n):
    if prev>0:
        now=arr[i]+prev
        if now<=k:
            ans+=1
            prev=0
        else:
            ans+=(now/k)
            prev=now%k
    else:
        now=arr[i]+prev
        ans+=(now/k)
        prev=now%k
    #print ans,prev



if prev>0:
    ans+=1
print ans


