n, k = [int(x) for x in input().split()]
lst = [int(x) for x in input().split()]
x=0
s=0
ans=0
for i in range(n):
        if (s+lst[i])<k and x==1:
                ans+=1
                s=0
                x=0
                continue
        s+=lst[i]
        ans+=s//k
        s=s%k
        x=1
        
if(s>0):
        print(ans+1)
else:
        print(ans)
                
