import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Code {



  public  void solve(Scanner in) {

    int n= in.nextInt();
    int k=in.nextInt();
    int i,j;
    long ans=0;

    int arr[] = new int[n];
    for(i=0;i<n;i++)
    {
      arr[i]=in.nextInt();
    }
     int pre=-1;
    int current;
    for(i=0;i<n;i++)
    {
      if(i>0) {
        pre=arr[i-1];
        arr[i]+=pre;
        }

        if(arr[i]>=k)
        {
          ans += arr[i] / k;
          arr[i] %= k;

        }
        else
        {
          if (pre>0 && i!=n-1)
          {
            ans++;
            arr[i]-=pre;
          }
        }


    }

    if(arr[n-1]>0)ans++;

    System.out.println(ans);

    }

  public static void main(String[] args) {
    //1 3 1 2 1
    Scanner in = new Scanner(System.in);
    Code code = new Code();
     while (in.hasNext()) code.solve(in);
  }
}
