import java.util.*;
public class problem_1070D{
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    StringTokenizer st = new StringTokenizer(scan.nextLine());
    StringTokenizer st1 = new StringTokenizer(scan.nextLine()); 
    int bags = 0;
    int n = Integer.parseInt(st.nextToken());
    int k = Integer.parseInt(st.nextToken());
    int trashRn = Integer.parseInt(st1.nextToken());
    int remain = 0;
    int bagsRn = 0;
    for (int i = 1; i < n; i++){
      trashRn += Integer.parseInt(st1.nextToken());
      remain = trashRn % k;
      bagsRn = trashRn / k;
      bags += bagsRn;
      trashRn %= k;
      if (bagsRn == 0 && remain != 0) {
    	  bags++;
    	  trashRn = 0;
      }
      //3
    }
    
    if (remain != 0 && bagsRn != 0) {
    	bags++;
    }
    System.out.println(bags);
  }
}