import java.util.*;
import java.lang.*;
import java.io.*;

public class Garbage
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] g = new int[n];
        for(int i=0;i < n;i++)
            g[i] = sc.nextInt();
        long res = g[0]/k;
        int carry = g[0]%k;
        for(int i=1;i < n;i++){
            boolean flag = false;
            if(carry != 0)
                flag = true;
            int bag = (g[i]+carry)/k;
            carry = (g[i]+carry)%k;
            if(bag == 0 && flag){
                res = res + 1;
                carry = 0;
            }
            else
                res = res + bag;
        }
        if(carry != 0){
            res = res + 1;
        }
        System.out.println(res);
	}
}
