import java.io.IOException;
import java.util.Scanner;

/**
 * Created by U_IST2-507-12 on 22.09.2018.
 */
public class lb1 {
    public static void main(String[] args)
    {
        long OldGarbage = 0, CurrentGarbage = 0;

        long N, K;
        long RES = 0;

        Scanner sc = new Scanner(System.in);

        N=sc.nextLong(); K = sc.nextLong();

        long curtr = 0;

        for (int i=0; i<N; i++)
        {

            curtr = sc.nextLong();

            if (OldGarbage == 0)
            {
                RES += curtr / K;
                OldGarbage = curtr % K;
            }
            else
            {
                if (( curtr + OldGarbage ) / K == 0) {RES++; OldGarbage = 0;}
                else {RES += ( curtr + OldGarbage ) / K; OldGarbage = ( curtr + OldGarbage ) % K;}
            }


        }

        if (OldGarbage != 0) RES++;

        System.out.println(RES);


    }
}
