import java.util.*;

public class maxwidth {


    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long arr[] = new long[n];
        for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }
        long count = 0;
        long prev = 0;
        for(int i=0;i<n-1;i++){

                long temp = k - (prev%k);
                if(arr[i]>temp)
                arr[i]-=temp;
                else
                    arr[i] = 0;
                count+=(prev+temp)/k;
                count+=arr[i]/k;
                prev = arr[i]%k;
            //System.out.println(count+" "+prev);

        }
        arr[n-1] += prev;
        if(arr[n-1]%k==0)
        System.out.println(count+arr[n-1]/k);
        else{
            System.out.println(count+(arr[n-1]/k)+1);
        }

    }




}


