
n,k=map(int,input().split())
l=list(map(int,input().split()))
c,r=0,0
for i in range(n):
    x=l[i]+r
    if x==0:
        continue
    elif x<k and r>0:
        c+=1
        r=0
    else:
        c+=(x//k)
        r=x%k
if r>0:
    c+=1
print(c)

########## My Ver. got RE again in test long arrays
#o=0
#n, k = map(int, input().split())
#a = [int(x) for x in input().split()]
#for j in range(n-1):
#    o+=a[j]//k
#    a[j+1]+=a[j]%k
#    if a[j]%k:
#        a[j+1]=max(a[j+1]-k,0)
#        o+=1
#o+=a[n-1]//k+[0,1][a[n-1]%k]
#print(o)        
