n,k=map(int,input().split())    
l=list(map(int,input().split()))
flag=[False]
sum=0
for i in range(n):
    sum+=l[i]//k
    if(i<n-1):
        if(flag[i]==True and l[i]//k==0):
            sum+=1
            flag.append(False)
        else:
            l[i+1]+=l[i]%k
            if(l[i]%k!=0):
                flag.append(True)
            else:
                flag.append(False)
    else:
        if(l[i]%k!=0):
            sum+=1

print(sum)

