

def compute():
    # Strategy, getting rid when number reach capacity, and on last day throw everything
    bag = 0
    dum = input().split()
    n,k = int(dum[0]),int(dum[1])
    dum = input().split()
    remain = 0
    for i in range(n):
        cur = int(dum[i]) + remain
     #   print(cur)
        if i == n-1:
            usage = cur//k
            return bag + usage + cur-usage*k

        usage = cur//k
        remain = cur - usage * k
   #     print(bag)
        bag += usage

if __name__ == '__main__':
    print(compute())