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

public class SolverD {

    StringTokenizer stok;
    BufferedReader br;
    PrintWriter pw;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            stok = new StringTokenizer(br.readLine());
        }
        return stok.nextToken();
    }

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

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

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

    private void run() throws IOException {
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        pw.flush();
        pw.close();
    }

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

    private void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        int mod = 0;
        long result = 0;
        for (int i=0; i<n; i++) {
            int cur = nextInt();
            if (mod > 0 && cur + mod < k) {
                result++;
                mod = 0;
            } else {
                cur +=mod;
                result += cur / k;
                mod = cur % k;
            }
        }
        if (mod > 0) {
            result++;
        }
        pw.println(result);
    }
}