// Where there is a will, there is a way !

import java.io.*;
import java.util.*;
import java.math.*;

public class Solution {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st;
        /*
        inputCopy
inputCopy
3 2
3 2 1
outputCopy
3
inputCopy
5 1
1000000000 1000000000 1000000000 1000000000 1000000000
outputCopy
5000000000
inputCopy
3 2
1 0 1
outputCopy
2
inputCopy
4 4
2 8 4 1
outputCopy
4
         */
        long ans = 0;
        st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        int[] arr = new int[n];
        int[] rem = new int[n];
        for (int i = 0; i < n; ++i) {
            arr[i] = Integer.parseInt(st.nextToken());
        }

        for (int i = 0; i < n - 1; ++i) {
            if (arr[i] == 0) {
                continue;
            }
            ans += arr[i] / k;
            rem[i] = arr[i] % k;
            if (rem[i] == 0) {
                continue;
            }

            arr[i + 1] += rem[i];
            rem[i] = 0;
            ++ans;
            arr[i + 1] -= k;
            if (arr[i + 1] < 0) {
                arr[i + 1] = 0;
            }

        }
        ans+=arr[n-1]/k;
        rem[n-1]=arr[n-1]%k;
        if (rem[n - 1] > 0) {
            ++ans;
            rem[n - 1] = 0;
        }
        pw.println(ans);
        pw.flush();
        pw.close();
    }

}
