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 a:
    if i==0:
        g=sum1/k
        
        if int(g)!=g:
            total_days+=1+int(g)
        else:
            total_days+=g
        sum1 = 0

    else:
        sum1+=i
if sum1!=0:
    g = sum1/k
   
    if int(g)!=g:
        total_days+=int(g)+1
    else:
        total_days+=g
    sum1 = 0
print(int(total_days))

    
        
        
    


        