# import atexit
# import io
# import sys
#
# _INPUT_LINES = sys.stdin.read().splitlines()
# input = iter(_INPUT_LINES).__next__
# _OUTPUT_BUFFER = io.StringIO()
# sys.stdout = _OUTPUT_BUFFER
#
#
# @atexit.register
# def write():
#     sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())


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

    last = 0
    cnt = 0

    for v in sm:
        if last > 0:
            cnt += 1
            v -= min(k - last, v)

        cnt += v // k
        last = v % k

    if last != 0:
        cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()
