import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author The Viet Nguyen
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader2 in = new InputReader2(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader2 in, PrintWriter out) {
            int n = in.nextInt(), k = in.nextInt(), as[] = in.nextInts(n);
            long sum = 0, car = 0, res = 0;
            for (int i = 0; i < n; ++i) {
                if (car > 0 && as[i] == 0) {
                    car = 0;
                    ++res;
                }
                sum = as[i] + car;
                res += sum / k;
                car = sum % k;
            }
            if (car > 0) {
                ++res;
            }
            out.println(res);
        }

    }

    static class InputReader2 {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader2(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] nextInts(int size) {
            int[] res = new int[size];
            for (int i = 0; i < size; ++i) res[i] = nextInt();
            return res;
        }

    }
}

