n,k = map(int,input().split())
t = list(map(int,input().split()))
wyn = 0
r = 0
for x in range(0,len(t),+2):
    if x == len(t)-1:
        wyn += int(t[x]/k)
        if t[x]%k != 0:
            wyn+=1
        break
    elif x == len(t)-2:
        wyn += int((t[x]+t[x+1])/k)
        if (t[x]+t[x+1]) % k != 0:
            wyn += 1
        break
    else:
        if t[x]+t[x+1] <= k:
            wyn += 1
            continue
        else:
            wyn += int((t[x]+t[x+1])/k)
            t[x+2] += int((t[x]+t[x+1])%k)
print(wyn)