#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
const int maxn=2e5+1000;
int a[maxn];	
using namespace std;
int main(){
  int n,c;
  long long ans=0;
  cin>>n>>c;
  for(int i=0;i<n;i++)
  {
  	cin>>a[i];
  }
  for(int i=0;i<n-1;i++){
  	if(a[i]<c&&a[i]){
  		int t=a[i+1]+a[i];
  		if(t>=c){
  			ans+=t/c;
  			a[i+1]=(a[i+1]+a[i])%c;
		  }
		else a[i+1]=0,ans++;  
  	}
  	else if(a[i]==c)a[i]=0,ans++;
  	else if(a[i]>c){
  		ans+=a[i]/c; 
  		a[i]=a[i]%c;
  		int t=a[i+1]+a[i];
  		if(t>=c){
  			ans+=t/c;
  			a[i+1]=(a[i+1]+a[i])%c;
		  }
		else ans++,a[i+1]=0;
	  }
  }
  int t;
  if(a[n-1]%c)t=a[n-1]/c+1;
  else t=a[n-1]/c;
  cout<<ans+t;
}