import java.io.FileNotFoundException;
import java.util.Scanner;



public class tester  
{ 
    static Scanner sc= new Scanner(System.in);
    
    
    public static void main(String args[]) throws FileNotFoundException{ 
    	//sc=new Scanner(new File("src/TESTER.txt"));
    	//sc = new Scanner(new File("dream.in"));
    	int n=sc.nextInt(),k=sc.nextInt();
    	long somme=0,vide=0;
    	boolean preserver = true; 
    	for(int i=0;i<n;i++) {
    		int a = sc.nextInt();
    		vide+=(long)a;
    		
    		if(vide>=k) {
    			somme+=(long)(vide/k);
    			vide=vide%k;
    			
    			if(vide!=0)	preserver = false;
    			else		preserver=true;
    		}
    		else {
    			if(vide!=0) {
    				if(preserver == false) {
        				somme++;vide=0;preserver=true;
        			}
        			else	preserver = false;
    			}
    		}
    	}
    	if(vide!=0)	somme++;
    	System.out.println(somme);
    	
    	          
    }
 
} 