import java.util.Scanner;

/*
 *Name : Mustakhov Taukekhan
 *E-mail : 170103122@stu.sdu.edu.kz
 *Date and venue : 02.12.2018/ SDU (Suleyman Demirel University)
 */
public class Garbage {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long k = sc.nextLong();
        int counterDay = 1;
        long sum = 0;
        long counter = 0;
        for (int i = 0; i < n; i++) {
            long q = sc.nextLong();
            sum += q;
            if (counterDay == 2) {
                counterDay = 1;
                if (sum >= k) {
                    counter += sum / k;
                    sum = sum % k;
                }else{
                    counter+=Math.ceil(sum/(k*1.0));
                    sum = 0;
                }
            }
            if (sum>q){
                counter+=Math.ceil(sum/(k*1.0));
            }
            counterDay++;
        }
        if (sum!=0){
            counter+=Math.ceil(sum/(k*1.0));
        }
        System.out.println(counter);
    }
}
