n,k =  [int(i) for i in input().split()]
a = [int(i) for i  in input().split()]
total_days = 0
sum1 = 0
for i in range(len(a)):
    if i==0:
        total_days+=a[i]//k
        a[i] = a[i]%k
    else:
        g=(a[i]+a[i - 1])//k
        if g==0  and (a[i]!=0 or a[i -1]!=0):
            total_days+=1
            a[i] =  0

        else:
            total_days+=g
            a[i] = (a[i]+a[i-1])%k
print(total_days)
        

    
        
        
    


        