import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Garbage {
	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);}
    }	
	public static void main(String[] args)throws Exception {
		PrintWriter out = new PrintWriter(System.out);
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long k = sc.nextLong();
		long[] array=new long[n+2];
		for(int i=1 ; i<n+1 ; i++) {
			array[i]=sc.nextLong();
		}
		long bags=0;
		long before=0;
		long leftfrombefore=0;
		for(int j=1 ; j<n+2 ; j++) {
			before=array[j-1];
			bags += (before)/k;
			leftfrombefore=before % k;
			if(leftfrombefore!=0 && array[j]>=(k-leftfrombefore)) {bags++;array[j]=array[j]-(k-leftfrombefore);} 
			else if(leftfrombefore!=0) {bags++;array[j]=0;}
			bags += array[j]/k;
			array[j]= array[j]%k; 
		}
		out.print(bags);
		out.flush();
	}

}
