temp = input().split(' ')
n = int(temp[0])
k = int(temp[1])
temp = input().split(' ')
mas = []
for i in range(n):
    mas.append(int(temp[i]))
mas.append(0)
cout = 0
for i in range(n):
    cout += mas[i]//k
    mas[i]-=mas[i]//k
    if mas[i]:
        if mas[i+1]:
            mas[i+1] = mas[i+1] - k + mas[i]
        cout += 1
print(cout)