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[] days = new long[2];
    static long res = 0, a;
    static int now, last;

    public static void main(String[] args) throws Exception {
        n = nextVal();
        k = nextVal();
        res = 0;

        for( int i = 1 ; i <= n ; i++ ) {
            a = nextVal();

            last = ( now = i & 1 ) ^ 1; // step by step --> get index of m for LAST_DAY and NOW

            if (i == n) { // CHECK
                res += Math.ceil( (double)( a + days[last] ) / k );
                break;
            }

            if ( days[last] != 0 ) { // "from last day with love" (c)
                res += Math.ceil( (double)days[last] / k );
                a -= ( k - days[last] % k );
                a = a < 0 ? 0 : a;
            }

            res += a / k;
            a %= k;
            days[now] = a;
        }

        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 ;
    }
}