import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
public static void main(String args[]){
       Scanner in=new Scanner(System.in);
       int n=in.nextInt();
       int k=in.nextInt();
       long arr[]=new long[n];
       for(int i=0;i<n;i++)
           arr[i]=in.nextLong();
       
       long rem=0;
       long bag=0;
       for(int i=0;i<n;i++){
           long aaj=(arr[i]+rem)/k;
           if(aaj==0 && rem==0){
               rem=arr[i]%k;
               continue;
           }
           else if(aaj==0 && rem!=0){
             rem=0;
             bag++;
             continue;
           }
           rem=(arr[i]+rem)%k;
           bag+=(arr[i]+rem)/k;
       }
       if(rem!=0)
           bag++;
       System.out.println(bag);
       
}
}

class FastScanner {
		java.io.BufferedReader br = new java.io.BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
 
		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
	}
      



