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();
      int k = sc.nextInt();
      
      int[] a = new int[n];
      for(int i = 0; i < n; i++) {
         a[i] = sc.nextInt();
      }
      
      boolean passed = false;
      long ans = 0;
      for(int i = 0; i < n - 1; i++) {
         if(a[i] < k && !passed) {
            passed = true;
            a[i + 1] += a[i];
         }
         else if(a[i] >= k) {
            ans += a[i] / k;
            a[i+1] += a[i] % k;
            passed = false;
         }
         else if(passed && a[i] != 0) {
            ans += 1;
            passed = false;
         }
      }
      ans += a[n - 1] / k;
      if(a[n - 1] % k != 0) 
         ans += 1;
      System.out.println(ans);
   }
}