import jdk.nashorn.internal.runtime.regexp.joni.ScanEnvironment;

import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.FileInputStream;

public class main {

    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        long ans = 0;
        int pre = 0;
        for (int i = 0; i < n; i++) {
            int cur = arr[i];
            if (pre > 0) {
                ans++;
                cur -= Math.min(cur, k - pre);
            }
            cur += pre;
            ans += cur/k;
            pre = cur%k;
        }
        System.out.println(ans);
    }
}