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):
    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:
            ans +=1
        ans+=(carry+a[i])//k
        carry = a[i]%k
print(ans)