import math
n,k = map(int,input().split())
l = list(map(int,input().split()))
b = 0
for i in range(n):
    if(i!=0):
        l[i] = l[i] + l[i-1]
    if(i!=0 and l[i]<k):
        b = b + 1
        l[i] = 0
    else:
        b = b + int(l[i]/k)
    l[i] = l[i]%k
if(l[n-1]!=0):
    b = b + math.ceil(l[n-1]/k)
print(b)