/* FastScanner Credits :- "SecondThread"
 * His youTube channel :-   https://www.youtube.com/channel/UCXbCohpE9IoVQUD2Ifg1d1g
 */

//
//import javax.print.DocFlavor;
//import javax.swing.*;
//import javax.swing.text.StyleContext;
//import java.awt.image.AreaAveragingScaleFilter;
import javax.print.attribute.Attribute;
import javax.print.attribute.HashAttributeSet;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.nio.channels.AcceptPendingException;
import java.nio.charset.IllegalCharsetNameException;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Collections;
import java.io.InputStreamReader;
import java.util.logging.SimpleFormatter;


public   class Main{

    static ArrayList<Integer> list = new ArrayList<>() ;
    static boolean A[] = new boolean[90000001] ;



    public static void main(String[] args) {

        try {
            PrintWriter fop = new PrintWriter(System.out);
            FastScanner fsca = new FastScanner();

           int n = fsca.nextInt();
           long k = fsca.nextLong();
           int rem = 0 ;
           long ct = 0 ;

           while (n-- > 1){
               long temp = fsca.nextLong() + rem;
               if (temp - rem == 0 ){
                   ct+= rem ;
                   rem = 0 ;
               }
               else {
               ct += (temp)/k ;
               rem = (int) ((temp)%k); }

           }
           long temp = fsca.nextLong() + rem;

           ct += (int)  Math.ceil((double)temp/(double) k) ;

           fop.println(ct);
































//        int tree[] = new int[4*n+1] ;
//        BuiltTree(A , 0 , n-1 , tree , 1);
//        int lazy[] = new int[4*n + 1] ;
//
//        updateRangeLazy(tree , lazy , 0 , n-1 , 0 , 2 , 10 , 1);
//        updateRangeLazy(tree , lazy , 0 , n-1 , 0 , 4 , 10 , 1);
//
//        fop.println(querylazy(tree , lazy , 0 , n-1 , 1 ,1 ,1));
//
//        updateRangeLazy(tree, lazy , 0 , n-1 , 10 , 4 , 3 ,1);
//        fop.println(querylazy(tree , lazy , 0 , n-1 , 3 , 5 , 1 ));


            fop.flush();
            fop.close();

        }
        catch (Exception e){
            return;
        }



    }
    /*-----------------------------------------------------------------------------------------------------------------------------------------------*/


    static void seive(int n ){
        int maxn = n ;
        //int maxn = 1000000  ;
        A[0] = A[1] = true ;

        for (int i=2 ; i*i<=maxn ; i++){
            if (!A[i]){
                for (int j=i*i ; j<=maxn ; j+= i)
                    A[j] = true ;
            }
        }

        for (int i=2 ; i<=maxn ;i++ )
            if (!A[i])
                list.add(i) ;

    }






















    // segment tree


    //  BuiltTree(A , 0 , n-1 , tree , 1);
    static void BuiltTree(int A[] , int s , int e , int tree[] , int index){
        if (s== e) {
            tree[index] = A[s] ;
            return;
        }

        int mid = (s+e)/2;
        BuiltTree(A , s , mid , tree , 2*index);
        BuiltTree(A , mid+1 , e , tree , 2*index+1);
        tree[index] = Math.min( tree[2*index], tree[2*index+1] ) ;
        return;

    }

    static int query(int tree[] , int ss , int se , int qs , int qe , int index){

        // complete overlap
        if (ss >= qs && se <= qe)
            return  tree[index];

        //no overlap
        if (qe < ss || qs > se)
            return Integer.MAX_VALUE ;

        // partial overlap
        int mid = (ss+se)/2 ;
        int left = query(tree , ss , mid , qs, qe , 2*index) ;
        int right = query(tree , mid+1 , se , qs, qe , 2*index+1) ;
        return Math.min(left , right) ;
    }


    static void update(int tree[] , int ss , int se , int i , int increment , int index){
        // i is the index of which we want to update the value

        if (i > se || i<ss)
            return;

        if (ss == se){
            tree[index] += increment ;
            return;
        }
        int mid = (ss+se)/2 ;
        update(tree , ss , mid , i , increment , 2*index);
        update(tree , mid+1 , se , i , increment , 2*index+1);
        tree[index]  = Math.min(tree[2*index], tree[2*index+1] ) ;

    }

    static  void updateRange(int tree[] , int ss , int se , int l , int r , int inc , int index){

        if (l > se || r< ss)
            return;

        if (ss == se){
            tree[index] += inc ;
            return;
        }

        int mid = (ss+se)/2 ;
        updateRange(tree , ss , mid , l , r , inc , 2*index);
        updateRange(tree , mid+1 , se , l , r , inc , 2*index + 1);

        tree[index] = Math.min( tree[2*index], tree[2*index + 1] ) ;
        return;


    }
    // Lazy rnage Update

    static void updateRangeLazy(int tree[] , int lazy[] , int ss ,int se , int l , int r , int increment , int index){

        if (lazy[index] != 0 ){
            tree[index] += lazy[index];

            if (ss != se){
                lazy[2*index]  +=  lazy[index];
                lazy[2*index + 1]  +=  lazy[index];
            }
            lazy[index ] = 0 ;
        }

        if (ss > r && se< l )
            return;

        if (ss >= l && se <= r) {
            tree[index] += increment;


            if (ss != se) {
                lazy[2 * index] += increment;
                lazy[2 * index + 1] += increment;
            }
            return;
        }

        int mid = (ss + se)/2 ;
        updateRange(tree , ss , mid , l , r , increment , 2*index);
        updateRange(tree , mid + 1 , se , l , r , increment , 2*index + 1);

        tree[index] =  Math.min( tree[2*index], tree[2*index + 1] ) ;

    }

    // min lazy query

    static int querylazy(int tree[] , int lazy[] , int ss , int se , int qs , int qe , int index) {

        if (lazy[index] != 0) {

            tree[index] += lazy[index];
            if (ss != se) {
                lazy[2 * index] += lazy[index];
                lazy[2 * index + 1] += lazy[index];
            }
            lazy[index] = 0;
        }

        if (ss > qe || se < qs)
            return Integer.MAX_VALUE;

        if (ss >= qs && se <= qe)
            return tree[index];

        int mid = (ss + se) / 2;
        int left = querylazy(tree, lazy, ss, mid, qs, qe, 2 * index);
        int right = querylazy(tree, lazy, mid + 1, se, qs, qe, 2 * index + 1);

        return Math.min(left, right);

    }





    /*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
    static boolean isEven(int a){
        if (a%2 == 0)
            return true ;
        else return false ;
    }
    static boolean isEvenLong(long a){
        if (a%2 == 0)
            return true ;
        else return false ;
    }


    static int gcd(int a , int b){
        if (b > a){
            int tenp = b ;
            b = a ;
            a = tenp ;
        }
        int temp = 0 ;
        while (b != 0){
            a %= b ;
            temp = b ;
            b = a ;
            a = temp ;
        }
        return a ;
    }

    static long gcd1( long a , long b){
        if (b > a){
            long tenp = b ;
            b = a ;
            a = tenp ;
        }
        long temp = 0 ;
        while (b != 0){
            a %= b ;
            temp = b ;
            b = a ;
            a = temp ;
        }
        return a ;
    }






    static final Random random=new Random();

    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }




    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long[] readLongArray(int n){
            long[] a = new long[n];
            for (int i=0 ; i<n ; i++)
                a[i] = nextLong() ;
            return a ;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }






}

