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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;


public class Main {
    static int i, j, k, n, m, t, y, x, sum;
    static long mod = 998244353;
    static FastScanner fs = new FastScanner();
    static int[] arr = new int[105];
    static PrintWriter out = new PrintWriter(System.out);


    public static void main(String[] args) {


        n = fs.nextInt();
        long k = fs.nextLong();
        long[] arr = new long[n];
        HashMap<Long, Integer> dataSet = new HashMap<>();

        for (i = 0; i < n; i++) {
            arr[i] = fs.nextInt();
        }

        Arrays.sort(arr);

        for(i=0;i<n;i++){
            dataSet.put(arr[i],i);
        }

        if (k == 1)
            out.println(n);

        else{
            int ans=0;
            int[] count = new int[n];

            for(i=0;i<n;i++){

                if(count[i]==0){
                    if(dataSet.containsKey(arr[i]*k) ){

                        count[dataSet.get(arr[i]*k)]=1;
                    }
                    ans++;
                }
            }
            out.println(ans);

        }
        out.close();

    }

    private static void query(int x, int[] arr) {
        if (x > 0 && x <= n && arr[x] == 0) {
            out.println("? " + x);
            out.flush();
            arr[x] = fs.nextInt();
        }
    }

    static long exp(long base, long pow) {
        if (pow == 0) return 1;
        long half = exp(base, pow / 2);
        if (pow % 2 == 0) return mul(half, half);
        return mul(half, mul(half, base));
    }

    static long mul(long a, long b) {
        return a * b % mod;
    }

    static long add(long a, long b) {
        return (a + b) % mod;
    }

    static long modInv(long x) {
        return exp(x, mod - 2);
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

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

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

    static class Pair implements Comparable<Pair> {
        long first, second;

        public Pair(int first, int second) {
            this.first = first;
            this.second = second;
        }

        public int compareTo(Pair o) {
            return Long.compare(first, o.first);
        }

    }


}