import java.util.*;
import java.io.*;
public class CF1070D {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int n = sc.nextInt();
      long k = sc.nextLong();
      long[] a = new long[n];
      long[] must = new long[n+1];
      for (int i = 0; i < n; i++) {
         long tmp = sc.nextLong();
         a[i] = tmp;
      }
   
      long count = 0;
      for (int i = 0; i < n; i++) {
         long c = (must[i] + k - 1) / k;
         long want = Math.min(c * k - must[i], a[i]);
         a[i] -= want;
         must[i+1] += a[i];
         count += c;
      }
   
      count += (must[n] + k - 1) / k;
   
      System.out.println(count);
   }
}