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}.
/**
 * Created with IntelliJ IDEA.
 * User: brzezinsky
 * Date: 12/13/12
 * Time: 5:43 PM
 * To change this template use File | Settings | File Templates.
 */

import javax.swing.plaf.metal.MetalTheme;
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class C extends Thread {
    public C(String inputFileName, String outputFileName) {
        try {
            if (inputFileName != null) {
                this.input = new BufferedReader(new FileReader(inputFileName));
            } else {
                this.input = new BufferedReader(new InputStreamReader(System.in));
            }
            if (outputFileName != null) {
                this.output = new PrintWriter(outputFileName);
            } else {
                this.output = new PrintWriter(System.out);
            }
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        }
    }

    private void solve() throws Throwable {
        int n = nextInt();
        long k = nextLong();
        int m = n;
        TreeMap<Long, Integer> cnt = new TreeMap<Long, Integer>();
        for (int i = 0; i < n; ++i) {
            long q = nextLong();
            cnt.put(q, 1 + (cnt.get(q) == null ? 0 : cnt.get(q)));
        }
        if (k == 1) {
            output.println(cnt.size());
            return;
        }
        long []a = new long[cnt.size()];
        n = 0;
        for (long q : cnt.keySet()) a[n ++] = q;
        Arrays.sort(a);
        boolean []used = new boolean[n];
        int tot = 0;
        for (int i = 0; i < n; ++i) {
            if (!used[i]) {
                used[i] = true;
                tot += cnt.get(a[i]);
                int t = Arrays.binarySearch(a, k * a[i]);
                if (t > 0) {
                    used[t] = true;
                }
            }
        }
        output.println(Math.max(tot, m - tot));
    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.close();
        }
    }

    public static void main(String... args) {
        new C(null, null).start();
    }

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

    private double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    private String next() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }

    private StringTokenizer tokens;
    private BufferedReader input;
    private PrintWriter output;
}