import java.util.*;

public class p1070D
{
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        long[] a = new long[n];
        for(int i = 0; i < n; i++)
            a[i] = scan.nextInt();
        long yesterday = 0;
        long result = 0;
        for(int i = 0; i < n; i++)
        {
            long today = a[i];
//            System.out.printf("Before: %d %d\n", today, yesterday);
            if(today + yesterday >= k)
            {
                today += yesterday;
                yesterday = 0;
            }

            result += today / k;
            today %= k;

            if(i == n - 1)
                yesterday += today;
            result += div(yesterday, k);
            yesterday = today;
//            System.out.println(result + " " + yesterday);
        }
        System.out.println(result);
    }

    public static long div(long a, long b)
    {
        return (a + b - 1) / b;
    }
}
