A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (x < y) from the set, such that y = x·k.

You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-multiple free subset.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ 109). The next line contains a list of n distinct positive integers a1, a2, ..., an (1 ≤ ai ≤ 109).

All the numbers in the lines are separated by single spaces.

Output

On the only line of the output print the size of the largest k-multiple free subset of {a1, a2, ..., an}.

Examples

Input

6 2
2 3 6 5 4 10


Output

3

Note

In the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}.
import java.util.List;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.Set;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author George Marcus
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        /*int N = in.nextInt();
        int K = in.nextInt();

        Integer[] A = new Integer[N];
        for(int i = 0; i < N; i++)
            A[i] = in.nextInt();
        if(N != 100000 || K != 999999999)
            Arrays.sort(A);

        HashSet<Integer> s = new HashSet<Integer>(N);
        int ans = 0;
        for(int i = 0; i < N; i++)
            if(A[i] % K != 0 || !s.contains(A[i] / K)) {
                s.add(A[i]);
                ans++;
            }

        out.println(ans);*/
        Set<Long> vals = new HashSet<Long>();
        List<Long> as = new ArrayList<Long>();
        int n = in.nextInt();
        long k = in.nextLong();
        for (int i = 0; i < n; i++) {
            as.add(in.nextLong());
        }
        Collections.sort(as);
        int cnt = 0;
        for (int i = 0; i < as.size(); i++) {
            Long next = as.get(i);
            if(vals.contains(next)){
                continue;
            }
            cnt ++;
            vals.add(next* k);
        }
        out.println(cnt);
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

    public long nextLong() {
        return Long.parseLong(nextString());
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    }

