import java.util.Scanner;

public class Main2 {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double dayCount = in.nextLong();
        double bagValue = in.nextLong();
        double[] days = new double[(int) dayCount];
        double sum = 0;
        double bagCount = 0;
        int nullCount = 0;

        for (int i = 0; i < dayCount; i++) {
            days[i] =in.nextInt();
        }

        for (int i = 0; i < days.length; i++) {
            if (days[i] == 0)
                nullCount++;
        }
        for (int i = 0; i < days.length; i++) {
            bagCount = days[i]/bagValue;
            sum += Math.ceil(bagCount);
        }

        if (nullCount%2==0)
            System.out.println(sum+1);
        else
            System.out.println(sum);


    }

}