import java.io.*;
import java.util.*;
public class D1070 
{
    public static void main(String args[])throws IOException
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int arr[]=new int[n];
        for(int i=0;i<n;i++)
        {
            arr[i]=sc.nextInt();
        }
        long c=0,sum=0,left=0;
        for(int i=0;i<n;i++)
        {
            sum=sum+arr[i]+left;
            //System.out.println(sum);
            if(sum<k)
            {
                if(left!=0)
                {
                    c++;
                    left=0;
                }
                else
                    left=sum;
            }
            else
            {
                c=c+(sum/k);
                left=sum%k;
            }
            //System.out.println(left+" "+i+" "+c);
            sum=0;
        }
        if(left>0)
            c++;
        System.out.println(c);
    }
}
