n,k = map(int,input().split())
a = list(map(int,input().split()))+[0]
ans = 0
s = a[0]
for i in range(1,n):
    x = s%k
    y = (s+k-1)//k
    ans+=y
    a[i]-=x
    a[i] = max(a[i],0)
    s = a[i]
if(s):
    ans+=(s+k-1)//k
print(ans)
        
        
    