import java.io.*;
import java.util.*;

public class Practice implements Comparator<Long> {
	public int compare(Long x,Long y) {
		if(x>y)
			return -1;
		else if(y>x)
			return 1;
		return 0;
	}
public static void main(String[] args)throws Exception{
	Scanner sc=new Scanner(System.in);
	PrintWriter out=new PrintWriter(System.out);
	Comparator<Long> comp=new Practice();
	int n=sc.nextInt();
	Long k=sc.nextLong();
	Long[] garbage=new Long[n+2];
	garbage[0]=(long)0;
	for(int i =1;i<=n;i++) {
		garbage[i]=sc.nextLong();
	}
	garbage[n+1]=(long)0;
	long collect=0;
	long ext=0;
	int count=0;
	for(int i =1;i<=n+1;i++) {
		collect+=garbage[i-1]/k;
		ext=garbage[i-1]%k;
		
			
			 if((k-ext)<=garbage[i]) {collect+=1;garbage[i]-=(k-ext);}//out.print("wwss");}
			
			
				
			 else if(ext!=0) {
			collect+=1;garbage[i]=(long)0;}
			collect+=garbage[i]/k;
			garbage[i]=garbage[i]%k;
			
			
		
		
				//out.println(collect);
		
				
	
	}
	out.println(collect);
	out.flush();}

	static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}
