import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Solve3 {

    public static void main(String[] args) throws IOException {
        new Solve3().solve();
    }

    public void solve() throws IOException {
        FastReader sc = new FastReader();
//        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt(), k = sc.nextInt();
        long s = 0;
        int x = sc.nextInt();
        s += x / k;
        x %= k;
        for (int i = 1; i < n; i++) {
            int t = sc.nextInt();
            t += x;
            if (x == 0) {
                x = t;
            } else {
                if (t / k != 0) {
                    s += t / k;
                    x = t % k;
                } else if (t > 0) {
                    s++;
                    x = 0;
                }
            }
        }
        if (x > 0) {
            s+= x/k;
            if(x%k!=0) s++;
        }
        System.out.println(s);

    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() throws FileNotFoundException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() throws IOException {
            if (st == null || !st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null || s.isEmpty()) {
                    return null;
                }
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

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

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

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

        public String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException ex) {
            }
            return s;
        }
    }
}
