#just itearte from n-1 to 0
#from every ele subtract the prevoius remaning that means
#we will r from a[i] to a[i+1]
from math import ceil
n,k=map(int,input().split())
arr=list(map(int,input().split()))
r=0;ans=0
for  i in range(n-1,-1,-1):
  arr[i]=max(0,arr[i]-r)
  ans+=ceil(arr[i]/k)
  if arr[i]%k!=0:r=k-arr[i]%k
  else:r=0
print(ans)
