def main():
    n, k = map(int, input().split(' '))
    a = list(map(int, input().split(' ')))

    prevstay = 0
    ans = 0
    for i in range(n):
        if prevstay != 0:
            ans += 1
            seats = k - prevstay
            
            if a[i] >= seats:
                a[i] -= seats
            else:
                a[i] = 0

        ans += a[i] //  k
        prevstay = a[i] % k

    if prevstay != 0:
        ans += 1

    print(ans)

    return 0

if __name__ == "__main__":
    exit(main())
