import math
if __name__ == "__main__":
 days,cap = list(map(int,input().split()))
 bin = list(map(int,input().split()))
 bags1 = []
 bags2 = []
 for i in range(0,days):
  if bin[i]%cap == 0:
   bags1.append(bin[i]//cap)
 
 for i in range(1,days):
  if bin[i] ==0:
   bags2.append(math.ceil(bin[i-1]/cap))
  if bin[i-1]==0 and bin[i]!=0:
   bags2.append(math.ceil(bin[i]/cap))
  if bin[i] !=0:
   bags2.append(math.ceil(bin[i-1]/cap))
   bin[i] = abs(bin[i] - abs(bin[i-1]-cap))
 print(max(sum(bags2),sum(bags1)))
 
 
   

  
