
n, m  = list(map(int, input().split()))
s = list(map(int, input().split()))
mdu = 0
need = 0
for i in range(n):
    x = (mdu+s[i])//m
    if mdu > 0 and x == 0:
        need += 1
        mdu = 0

    else:
        mdu= (mdu+s[i])%m
        need += x+ 1 if (i == (n-1) and mdu > 0) else x
print(need)