As we all know, Winnie-the-Pooh just adores honey. Ones he and the Piglet found out that the Rabbit has recently gotten hold of an impressive amount of this sweet and healthy snack. As you may guess, Winnie and the Piglet asked to come at the Rabbit's place. Thus, there are n jars of honey lined up in front of Winnie-the-Pooh, jar number i contains ai kilos of honey. Winnie-the-Pooh eats the honey like that: each time he chooses a jar containing most honey. If the jar has less that k kilos of honey or if Winnie-the-Pooh has already eaten from it three times, he gives the jar to Piglet. Otherwise he eats exactly k kilos of honey from the jar and puts it back. Winnie does so until he gives all jars to the Piglet. Count how much honey Piglet will overall get after Winnie satisfies his hunger.

Input

The first line contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 100). The second line contains n integers a1, a2, ..., an, separated by spaces (1 ≤ ai ≤ 100).

Output

Print a single number — how many kilos of honey gets Piglet.

Examples

Input

3 3
15 8 10


Output

9

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Quan
 */
//public class Main {
//    
//    public static void main(String[] args) {
//        // TODO code application logic here
//        InputStream inputStream = System.in;
//        InputReader in = new InputReader(inputStream);
//        int n = in.nextInt();
//        int k = in.nextInt();
//
//        int[] a = new int[n];
//        for (int i = 0; i < n; i++) {
//            a[i] = in.nextInt();
//        }
//
//        Arrays.sort(a);
//        ArrayList<Integer> list = new ArrayList<>();
//        for (int i = 0; i < n; i++) {
//            list.add(a[i]);
//        }
//        int max = a[n - 1];
//        int sum = 0;
//
//        while (max != 0) {
//            int s = maxIndex(list);
//            max = list.get(s);
//
//            if (list.get(s) >= k) {
//                list.set(s, list.get(s) - k);
//                if (list.get(s) == (a[s] - 3 * k) || list.get(s) < k) {
//                    sum += list.get(s);
//                    list.set(s, 0);
//                }
//            } else if (list.get(s) > 0) {
//                sum += list.get(s);
//                list.set(s, 0);
//            }
//            max = list.get(maxIndex(list));
//        }
//        System.out.println(sum);
//    }
//
//    static int maxIndex(ArrayList<Integer> list) {
//        int index = 0;
//        for (int i = 0; i < list.size() - 1; i++) {
//            if (list.get(i + 1) >= list.get(i)) {
//                index = (i + 1);
//            }
//        }
//        return index;
//    }
//
//    static class InputReader {
//
//        public BufferedReader reader;
//        public StringTokenizer tokenizer;
//
//        public InputReader(InputStream stream) {
//            reader = new BufferedReader(new InputStreamReader(stream), 32768);
//            tokenizer = null;
//        }
//
//        public String next() {
//            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
//                try {
//                    tokenizer = new StringTokenizer(reader.readLine());
//                } catch (IOException e) {
//                    throw new RuntimeException(e);
//                }
//            }
//            return tokenizer.nextToken();
//        }
//
//        public int nextInt() {
//            return Integer.parseInt(next());
//        }
//
//    }
//}

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		FileReader input = new FileReader("input.txt");
		FileWriter output = new FileWriter("output.txt");
		PrintWriter out = new PrintWriter(output);
		Scanner cin = new Scanner(input);
		int n=cin.nextInt();
		int k=cin.nextInt();
		int res=0;
		for(int i=0;i<n;i++){
			int tmp=cin.nextInt();
			if(tmp<k){
				res += tmp;
			}else if(tmp-k<k){
				res +=(tmp-k);
			}else if(tmp-2*k<k){
				res +=(tmp-2*k);
			}else{
				res +=(tmp-3*k);
			}
		}
		out.print(res);
		out.flush();
		out.close();
	}

}
