n,k = map(int,input().split())
a = list(map(int,input().split()))

res,ans = 0,0

for i in a:
    res += (ans + i)//k
    if ans + i < k and ans != 0:
        ans = 0
        res+=1
        continue
    ans = (ans + i)%k
print(res+bool(ans))