n, k = map(int, input().split())
a = list(map(int,input().split()))
cnt = 0
if n>1:
    if n%2==0:
        for i in range(n):
            if i<n-3 and i%2==0:
                if (a[i]+a[i+1])<k:cnt+=1; i+=2
                else: cnt += (a[i]+a[i+1])//k; a[i+2] += (a[i]+a[i+1])%k; i+=2
            if i==n-2:
                cnt += (a[i]+a[i+1])//k if (a[i]+a[i+1])%k==0 else ((a[i]+a[i+1])//k)+1;break

    else:
        for i in range(n):
            if i<n-2 and i%2==0:
                if (a[i]+a[i+1])<k:cnt+=1; i+=2
                else:cnt += (a[i]+a[i+1])//k; a[i+2] += (a[i]+a[i+1])%k; i+=2
            if i==n-1:
                cnt += a[i]//k if a[i]%k==0 else ((a[i]//k) + 1);break

else:
    cnt += a[0]//k if a[0]%k==0 else a[0]//k+1

print(cnt)
                    

    
