//codeforces_1070D

import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.lang.Math.*;
import java.math.*;

public class Main{

	static PrintWriter go = new PrintWriter(System.out);

	public static void main(String args[]) throws IOException,FileNotFoundException {
		BufferedReader gi = new BufferedReader(new InputStreamReader(System.in));
		int[] l = parseArray(gi);
		int n = l[0];
		int m = l[1];
		l = parseArray(gi);
		long acc = 0;
		long ans = 0;
		for ( int k = 0; k < n; k++){
			if ( (acc + l[k])%m == 0 ){
				ans += (acc + l[k])/m;
				acc = 0;
			}else if ( (acc + l[k])%m <= l[k] ){
				ans += (acc + l[k])/m;
				acc = (acc + l[k])%m;
			}else{
				ans += (acc + l[k])/m + 1;
				acc = 0;
			}
		}
		if ( acc > 0 ){ ans++; }
		go.println(ans);

		go.close();
	}

	static int[] parseArray(BufferedReader gi) throws IOException{
		String[] line = gi.readLine().trim().split(" ");
		int[] rez = new int[line.length];
		for ( int k = 0; k < line.length; k++){
			rez[k] = Integer.parseInt(line[k]);
		}
		return rez;
	}

}