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

/**
 * @author gamezovladislav
 */

public class TaskD {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        Solve solve = new Solve(in, out);
        solve.solve();
        out.close();
    }

    private static class Solve {

        private final InputReader in;
        private final PrintWriter out;

        public Solve(InputReader in, PrintWriter out) {
            this.in = in;
            this.out = out;
        }

        public void solve() {
            int n = in.nextInt();
            long k = in.nextLong();
            long rem = 0L;
            long ans = 0L;
            for (int i = 0; i < n; i++) {
                long x = in.nextLong();
                rem += x;
                if (rem < k && rem != x) {
                    ans += rem > 0 ? 1 : 0;
                    rem = 0;
                } else {
                    ans += rem / k;
                    rem %= k;
                }
            }
            ans += rem > 0 ? 1 : 0;
            out.print(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(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 long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}
