n,k = [int(k) for k in input().split()]
a = [int(k) for k in input().split()]
carry = 0 
ans = 0
for i in range(n):
    temp =0
    if i==n-1:
        ans+=(carry+a[n-1])//k
        if (carry+a[n-1])%k:
            ans +=1
    else:
        
        if a[i] == 0 and carry!=0:
            temp+=1
        temp+=(carry+a[i])//k
        carry = max(0,(carry+a[i])-(temp*k))
        ans += temp
        
print(ans)