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

public class ProblemC {

    public static void main(String[] args) throws Exception {
        new ProblemC();
    }

    private BufferedReader in = null;
    private PrintWriter out = null;
    private StringTokenizer tok = new StringTokenizer("");

    public ProblemC() throws Exception {
        init();
        solve();
        in.close();
        out.close();
    }

    private void solve() throws Exception {
        int n = nextInt();
        long k = nextInt();
        if (k == 1) {
            out.println(n);
            return;
        }
        long[] a = new long[n];
        for (int i = 0; i < n; ++i) {
            a[i] = nextInt();
        }
        Arrays.sort(a);
        boolean[] bad = new boolean[n];
        int ans = 0;
        for (int i = 0; i < n; ++i) {
            if (bad[i]) {
                continue;
            }
            ++ans;
            long t = a[i] * k;
            int j = Arrays.binarySearch(a, t);
            if (j >= 0) {
                bad[j] = true;
            }
        }
        out.println(ans);
    }


    private void init() throws FileNotFoundException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
    }


    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }


    private String nextToken() throws IOException {
        while (!tok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            tok = new StringTokenizer(s);
        }
        return tok.nextToken();
    }


    private int max(int ... a) {
        int res = Integer.MIN_VALUE;
        for (int i : a) {
            res = Math.max(res, i);
        }
        return res;
    }
    private int min(int ... a) {
        int res = Integer.MAX_VALUE;
        for (int i : a) {
            res = Math.min(res, i);
        }
        return res;
    }

    private void read(int[] a) throws IOException {
        for (int i = 0; i < a.length; i++) {
            a[i] = nextInt();
        }
    }

    private void println(int[] a) {
        for (int b : a) {
            out.print(b + " ");
        }
        out.println();
    }

}
            