import java.util.*;
import java.lang.*;
public class Solution {

    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int k=s.nextInt();
        long bags=0;
        boolean b=false;
        int temp=0;
        for(int i=0;i<n;i++)
        {
            int g=s.nextInt();
            if(!b)
            {
                bags+=g/k;
                temp=g%k;
                if(temp>0)
                    b=true;
                
            }
            else
            {
                g+=temp;
                bags+=g/k;
                if(g/k==0)
                {
                    bags+=1;
                    b=false;
                    continue;
                }
                temp=g%k;
                if(temp==0)
                    b=false;
            }
        }
        if(b)
            bags+=1;
        System.out.println(bags);
            
        
        
    }
}