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.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeSet;

/**
 * 111118315581
 *
 * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3
 *
 * @author pttrung
 */
public class C {

    //   public static long x, y, gcd;
    //   public static int Mod = 1000000007;
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        //   System.out.println(Integer.MAX_VALUE);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));

        int n = in.nextInt();
        long k = in.nextInt();
        long[] data = new long[n];
        boolean[] check = new boolean[n];
        TreeSet<Node> set = new TreeSet();
        for (int i = 0; i < n; i++) {
            data[i] = in.nextInt();

            set.add(new Node(i, data[i]));
        }
        int result = n;
        for (int i = 0; i < n; i++) {
            Node node = set.pollFirst();
            if (!check[node.index]) {               
                
                Node other = set.floor(new Node(0, node.val * k));
                if (other != null && other.val == k * node.val) {
                    check[other.index] = true;
                    result--;
                }

            }
        }
        out.println(result);


        out.close();
    }

    public static class Node implements Comparable<Node> {

        int index;
        long val;

        public Node(int index, long val) {
            this.index = index;
            this.val = val;
        }

        @Override
        public int compareTo(Node o) {
            if (val < o.val) {
                return -1;
            } else if (val > o.val) {
                return 1;
            }
            return 0;
        }
    }

    public static double area(Point[] data) {

        double result = 0;
        for (int i = 0; i < data.length; i++) {
            int next = (i + 1) % data.length;
            result += (data[i].x * data[next].y) - (data[i].y * data[next].x);
        }
        return result / 2;
    }

    public static boolean validate(Point[] p, boolean[] check) {
        for (int i = 0; i < p.length; i++) {
            int next = (i + 1) % p.length;
            int val = (p[i].x - p[next].x) * (p[i].x - p[next].x) + (p[i].y - p[next].y) * (p[i].y - p[next].y);
            if (check[val]) {
                return false;
            }
        }
        int val = (p[0].x - p[2].x) * (p[0].x - p[2].x) + (p[0].y - p[2].y) * (p[0].y - p[2].y);
        if (check[val]) {
            return false;
        }
        val = (p[1].x - p[3].x) * (p[1].x - p[3].x) + (p[1].y - p[3].y) * (p[1].y - p[3].y);
        if (check[val]) {
            return false;
        }
        return true;

    }

    public static int cross(Point a, Point b) {
        int val = a.x * b.y - a.y * b.x;
        return val;
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x) {
                return x - o.x;
            } else {
                return y - o.y;
            }
        }
    }
//    public static void extendEuclid(long a, long b) {
//        if (b == 0) {
//            x = 1;
//            y = 0;
//            gcd = a;
//            return;
//        }
//        extendEuclid(b, a % b);
//        long x1 = y;
//        long y1 = x - (a / b) * y;
//        x = x1;
//        y = y1;
//
//    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}
