n,k=input().split(' ')
n=int(n)
k=int(k)
arr = input().split(' ')
Ans = 0;
remain = 0;
for i in range(0,n):
    temp = (remain + int(arr[i])) // k;
    if temp == 0 and remain !=0 :
        ++Ans;
        remain = int(arr[i])//k;
    else:
        remain = (remain + int(arr[i])) - temp*k;
        Ans += temp;
if remain != 0:
    ++Ans
print(Ans)

		      		 	 	 		     	 			