
import java.util.*;

public class Main
{

public static void main(String args[]) {
	Scanner s=new Scanner(System.in);
int n=s.nextInt(),k=s.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++){
	a[i]=s.nextInt();
}
int r=0;
long ans=0;
for(int i=0;i<n;i++) {
	int xx=(a[i]+r)/k;
	if(xx==0&&r==0) {
		r=a[i]%k;
		continue;
	}
	if(xx==0&&r!=0) {
		r=0;
		ans++;
		continue;
	}
	ans+=xx;
	r=(a[i]+r)%k;
}
System.out.println(ans);


}
}

