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.math.BigInteger;
import java.util.*;

public class TaskC {

    static Integer[][]dp;
    static int n, m, ans;
    static String s;
    static TreeSet<Integer> primes;

    static void generatePrimes()
    {
        primes = new TreeSet<>();
        primes.add(2);

        for (int i = 3 ; i <= (1e6) ; i++,++i)
        {
            int j = 2;
            boolean isPrime = true;
            while (1l*j*j <= i)
            {
                if(i%j == 0)
                {
                    isPrime = false;
                    break;
                }
                j++;
            }
            if(isPrime)primes.add(i);
        }

    }


    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        int k = sc.nextInt();
        Integer[]arr = new Integer[n];
        TreeSet<Long> ans = new TreeSet<>();
        HashSet<Long> set = new HashSet<>();
        for (int i = 0 ; i < n ; i++)
            set.add(1l*(arr[i] = sc.nextInt()));
        Arrays.sort(arr);
        for (int i = 0 ; i < n ; i++) {
           // System.out.println(arr[i]/k);
            if ((arr[i] % k == 0 && !ans.contains(1l*arr[i] / k)))
                ans.add(1l * arr[i]);
            else if (arr[i] % k != 0)
                ans.add(1l * arr[i]);
        }
        pw.print(ans.size());
     //   System.out.println(ans);
        pw.close();

    }



    private static long gcd(long a, long b) {
        if( b == 0)
            return a;
        return gcd(b  , a%b);
    }

    static long lcm(int a, int b)
    {
        return (a*b)/gcd(a, b);
    }


    private  static int dis(int xa , int ya , int xb , int yb)
    {
        return (xa-xb)*(xa - xb) + (ya- yb)*(ya-yb);
    }


    static class Pair implements Comparable<Pair> {
        double x,y;


        public Pair(double x, double y) {
            this.x = x;
            this.y = y;
        }

        public int compareTo(Pair o) {
           /* if (x == o.x)
                return y - o.y;
            return x - o.x;*/
           return  0;
        }
        public double dis(Pair a){

            return (a.x - x)*(a.x - x) + (a.y-y)*(a.y-y);
        }

        public String toString() {
            return  x+" "+ y;
        }
        public boolean overlap(Pair a)
        {
        if((this.x >= a.x && this.x <= a.y) || (a.x >= this.x && a.x <= this.y)) return true;
            return false;

        }
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

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

        public boolean check() {
            if (!st.hasMoreTokens())
                return false;
            return true;
        }

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

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

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

        public double nextDouble() {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() {
            try {
                return br.ready();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}