import java.util.*;
public class main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int days=scanner.nextInt();
        long packageCapaciti=scanner.nextLong();
        long[]arrayDay=new long[days];
        long packat =0;
        long remainder=0;
        for (int i = 0; i < days; i++) {
            arrayDay[i]=scanner.nextInt();
            if ((i%2==0)&&remainder>0) {
                packat++;
                remainder=0;
            }
            arrayDay[i]+=remainder;
            packat+=(arrayDay[i]/packageCapaciti);
            remainder=(arrayDay[i]%packageCapaciti);
            if((i+1)==days&&remainder!=0){
                packat++;
            }
        }
        System.out.println(packat);
    }
}

