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.*;
import java.util.StringTokenizer;

/**
 *
 * @author Prateep
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        InputStream inputStream =new FileInputStream("input.txt");
    OutputStream outputStream =new FileOutputStream("output.txt");
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
    }
}

class TaskB{
    public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException{
        int n=in.nextInt(),k=in.nextInt();
        long forPiglet=0;
        for(int i=1;i<=n;i++){
            int amountInJar=in.nextInt();
            if(k*3>=amountInJar)forPiglet+=amountInJar%k;
            else forPiglet+=amountInJar-k*3;
        }
        out.println(forPiglet);
    }
}
class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private BufferedReader br;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        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 String nextWhole() throws IOException{
        br=new BufferedReader(new InputStreamReader(System.in));
        return br.readLine();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong(){
        return Long.parseLong(next());
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
    public String nextLine(){
    try{
            return reader.readLine();
    }catch (IOException e){
            throw new RuntimeException(e);
    }
    }
}
class Pair<A, B> {
    private A first;
    private B second;

    public Pair() {
        super();
    }
    public Pair(A first, B second) {
        super();
        this.first = first;
        this.second = second;
    }

    @Override
    public int hashCode() {
        int hashFirst = first != null ? first.hashCode() : 0;
        int hashSecond = second != null ? second.hashCode() : 0;

        return (hashFirst + hashSecond) * hashSecond + hashFirst;
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof Pair) {
            Pair otherPair = (Pair) other;
            return 
            ((  this.first == otherPair.first ||
                ( this.first != null && otherPair.first != null &&
                  this.first.equals(otherPair.first))) &&
             (  this.second == otherPair.second ||
                ( this.second != null && otherPair.second != null &&
                  this.second.equals(otherPair.second))) );
        }

        return false;
    }

    @Override
    public String toString()
    { 
           return "("+first+","+second+")"; 
    }

    public A getFirst() {
        return first;
    }

    public void setFirst(A first){
        this.first=first;
    }
    public B getSecond(){
        return second;
    }
    public void setSecond(B second){
        this.second=second;
    }
}
