n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*n
i=0
p=0
for i in range(n-1):
    if a[i]==0 and b[i-1]!=0:
        p+=1
    else:
        p+=(a[i]+b[i-1])//k
        b[i]=(a[i]+b[i-1])%k
if n==1:
    if a[0]%k==0:
        print(a[0]//k)
    else:
        print(a[0]//k+1)
else:
    
    a[n-1]+=b[i+1]
    if (a[n-1]+b[i-1])%k==0:
        print(p+(a[n-1]+b[i-1])//k)
    else:
        print(p+(a[n-1]+b[i-1])//k+1)
        