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

if sum1>0:
    bag+=1
print(bag)

        

    
        
        
    


        