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;

    long arr[] = new long[n+2];

    Arrays.fill(arr,0);

    for(i=1;i<=n;i++)
    {
      arr[i]=in.nextInt();
    }

    for(i=1;i<=n;i++)
    {


      if(arr[i] +arr[i-1]>=k)
      {
        arr[i]+=arr[i-1];
        ans += arr[i]/ k;
        arr[i] %= k;
        arr[i-1]=0;
      }
      else
      {


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

      }


    }

    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);
  }
}
