import java.util.*;
public class Main
{
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int k=s.nextInt();
		long[] arr=new long[n];
		for(int i=0;i<n;i++) arr[i]=s.nextLong();
		
		long ans=0;
		long carry;
		if(n%2==0){
		    carry=0;
		    for(int i=0;i<n;i+=2){
		        long curr=arr[i]+arr[i+1]+carry;
		        if(curr>=k){
		            ans+=(curr/k);
		            carry=curr%k;
		        } else{
		            carry=0;
		            if(curr>0)
		            ans++;
		        }
		    }
		} else{
		    carry=0;
		    for(int i=0;i<n-1;i+=2){
		        long curr=arr[i]+arr[i+1]+carry;
		        if(curr>=k){
		            ans+=(curr/k);
		            carry=curr%k;
		        } else{
		            carry=0;
	            if(curr>0)
	            ans++;
		        }
		    }
		    
		    long curr=arr[n-1];
		    if(curr>=k){
		            ans+=(curr/k);
		            carry=curr%k;
		        } else{
		            
		            carry=0;
		            if(curr>0)
		            ans++;
		        }
		    
		}
		if(carry>0) ans++;
		System.out.println(ans);
		
	}
}
