n, k = tuple(int(_) for _ in input().split())
a = tuple(int(_) for _ in input().split())
 
total_bags, c = 0, 1
pre = a[0]
while c < len(a):
    b = a[c]
    if c == len(a) - 1:
        total_bags += int((pre + b) / k)
        if (pre + b) % k != 0:
            total_bags += 1
    elif pre % k == 0:
        total_bags += int(pre / k)
        pre = b
    else:
        total_bags += int(pre / k) + 1
        pre = max(0, b - k + pre % k)
    c += 1
 
if len(a) == 1:
    total_bags = int(a[0] / k)
    if a[0] % k != 0:
        total_bags += 1
print(int(total_bags))