
# coding: utf-8

# In[12]:


n, k = map(int, input().strip().split())

garbage = []
garbage[:] = list(map(int, input().strip().split()))

total = 0
addi = 0
addiFlag = False
for day in range(n):
    if addiFlag :
        addiFlag = False
        if (addi + garbage[day] > k) :
            addi = 0
            garbage[day] -= k
            total += 1
        else:
            addi = 0
            garbage[day] = 0
            total += 1
    total += (garbage[day] + addi) // k
    addi = garbage[day] % k
    if addi > 0:
        addiFlag = True
    if day == (n - 1) :
        if addi > 0:
            total += 1
            
print(total)

