from math import ceil,floor
def main():
    n,k=list(map(int,input().split(" ")))
    li=list(map(int,input().split(" ")))
    ans=0
    lilen=len(li)
    for i in range(lilen):
        
        if i!=lilen-1:
            if li[i+1]==0:
                ans+=ceil(li[i]/k)
            else:
                ans+=floor(li[i]/k)
                li[i+1]+=li[i]%k
        else:
            ans+=ceil(li[i]/k)
    print(ans)

if __name__=="__main__":
    main()