import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    private static final Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++)a[i] = scanner.nextInt();
        // for(int i = 0; i < n; i++)System.out.println(a[i]);
        long ans = a[0] / k;
        int p = a[0] % k;
        for(int i = 1; i < n; i++){
            if(p > 0){
                int b = p / k;
                if(b * k < p)b++;
                ans += b;
                
                int remaining = (b * k - p);
                a[i] -= Math.min(a[i], remaining);
            }
            ans += a[i] / k;
            p = a[i] % k;
        }
        if(p > 0){
            ans += p / k;
            p %= k;
            if(p > 0)ans++;
        }
        System.out.println(ans);
    }
}
