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 - i
        ans += 1
    else:
        tmp = rem
print(ans)