n,k = map(int, input().split())
a = list(map(int, input().split()))
ans, tmp = 0, 0
for i in a:
    ans += (i+tmp)//k
    rem = (i+tmp)%k
    if rem > i:
        tmp = rem - tmp
        ans += 1
    else:
        tmp = rem
    # print(tmp, rem)
if tmp: ans += 1
print(ans)