import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Dont {
    static BufferedReader jin = new BufferedReader( new InputStreamReader( System.in ) );
    static long n, k;
    static long a, res, now;

    public static void main(String[] args) throws Exception {
        n = nextVal();
        k = nextVal();
        for( int i = 0 ; i < n ; i++ ) {

            a = nextVal();

            if( now > 0 ) { // ~ free space

                now += a;

                if( now >= k ) {
                    res += now / k;
                    now %= k;
                } else {
                    now = 0;
                    res++;
                }

            } else { // not free --> drop trash

                now += a;
                res += now / k;
                now %= k;

            }

            //System.out.println( " res :  " + res + "  now :  " + now );

        }

        if( now == 0 ) res += ( now % k == 0 ) ? (now/k) : ( (now/k) + 1 );

        System.out.print( res );
    }

    static long nextVal() throws  Exception {
        long res = 0;
        boolean neg;
        int ch = jin.read();
        while( ch <= ' ' ) ch = jin.read();
        if( neg = ch == '-' ) ch = jin.read();
        do{ res = res * 10 + ch - '0';
        } while( jin.ready() ? ( '0' <= ( ch = jin.read() ) && ch <= '9' ) : false );
        return neg ? -res : res ;
    }
}