
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author User
 */
public class Others {
    static Scanner sc = new Scanner(System.in);
    
    public static void main(String[] args) {
        long n = sc.nextLong();
        long cap = sc.nextLong();
        sc.nextLine();
        String[] input = sc.nextLine().split(" ");
        long num;
        long sum = 0;
        long count = 0;
        long temp = 0;
        for (String item: input) {
            num = Integer.parseInt(item);
            num += temp;
            if (num == temp) temp = 0;
            else if (num < cap) {
                temp -= (long) cap-num;
                count += (long) 1;
            }
            else if (num > cap) { 
                temp += (long) num%cap;
                count += (long) Math.floor(num/cap);
            }
            else {
                temp = 0;
                count += (long) num/cap;
            }
            
            
        }   
        System.out.println(count);
    }
}
