import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextInt();
        long k = in.nextInt();
        long today, todayBags;
        long bags = 0, lastDay = 0;
        for (long i = 0; i < n; i++) {
            today = (in.nextInt() + lastDay);
            todayBags = today / k;
            if (today < k && lastDay != 0) {
                todayBags++;
                today -= lastDay;
            }
            if (today - todayBags * k > 0) {
                lastDay = today % k;
            } 
        }
        if (lastDay != 0) bags++;
        System.out.println(bags);

    }
}