import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int k = scan.nextInt();
    int arr[] = new int[n];
    for(int i=0;i<n;i++){
      arr[i]=scan.nextInt();
    }
    long bags=0;
    int today=0;
    int yesterday=0;
    int capacity=0;
    for(int i=0;i<(n-1);i++){
      today=arr[i];
      capacity=today+yesterday;
      if(yesterday!=0 && capacity>=k){
        yesterday=capacity%k;
        bags=bags+(capacity/k);
      }
      else if(yesterday!=0 && capacity<k){
        yesterday = 0;
        bags++;
      }
      else if(yesterday==0 && capacity>=k){
        yesterday=capacity%k;
        bags=bags+capacity/k;
      }
      else if(yesterday==0 && capacity<k){
        yesterday = capacity;
      }
    }
    today=arr[n-1];
    capacity=today+yesterday;
    if(capacity>=k)
      bags=bags+(long)Math.ceil(capacity/k);
    else if(capacity>0)
      bags++;
    System.out.println(bags);
  }
}
