n,k=[int(s) for s in input().split()]

a=[int(s) for s in input().split()]

def check():
    n=len(a)
    res=0
    sum0=0
    for i in range(n):

        if res==0 and i<n-1:
            if a[i]<k:
                res=a[i]
            else:
                sum0+=int((a[i])/k)
                res=a[i]%k
        else:
          sum0+=max(1,int((a[i]+res)/k))
        #print(res, max(int((a[i] + res) / k), 1))
          res = (a[i] + res) % k if a[i] + res >= k else 0

    print(sum0)

check()