# cook your dish here
n,k = map(int,input().split())
a = list(map(int,input().split()))
rem = 0
days = 0
for i in range(n):
    if (i==n-1) :
        days = days + (a[n-1] + rem + k-1)//k
    else:
        x = rem+a[i]
        if (x%k==0) :
            days += x//k
            rem = 0
        else:
            if (rem>0):
                days += 1
                a[i] -= (k-rem)
            if (a[i]>=0) :
                days += a[i]//k
                rem = a[i]%k
            else:
                rem = 0
print(days)
