
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by Serafim on 18.10.2018.
 */
public class ForBuff {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] s = reader.readLine().split("\\s+");

        int n = Integer.parseInt(s[0]);
        int k = Integer.parseInt(s[1]);
        long ans = 0;
        s = reader.readLine().split("\\s+");
        int next = 0;
        for (int i = 0; i < n; i++) {
            int newd = Integer.parseInt(s[i]);
            if (next > 0) {
                int add = k - next;
                newd = Math.max(0, newd - add);
                ans ++;
            }
            ans += newd / k;
            next = newd % k;
        }
        if (next != 0) {
            ans++;
        }
        System.out.println(ans);

    }
}
