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.util.*;
import java.io.*;
/**
 *
 * @author Do Quoc bao
 */
public class ProblemC {
    public static void main(String[] args) throws java.lang.Exception {
	in.init(System.in);
	int n=in.nextInt(),k=in.nextInt(),i,j;
	if (n==1) {System.out.println(1);return ;}
	ArrayList<Long> arr=new ArrayList<>();
	ArrayList<ArrayList<Long> > list=new ArrayList<>();
	for (i=0;i<n;++i) arr.add((long)in.nextInt());
	if (k==1) {
	    TreeSet<Long> set=new TreeSet<>();
	    for (i=0;i<n;++i) set.add(arr.get(i));
	    System.out.println(set.size());
	    return ;
	}
	Collections.sort(arr);
	boolean[] check=new boolean[n];
	for (i=0;i<n;++i) if (!check[i]) {
	    long ll=arr.get(i);
	    check[i]=true;
	    ArrayList<Long> nList=new ArrayList<>();
	    nList.add(ll);
	    while (true) {
		long x=ll*k;
		Integer vt=Collections.binarySearch(arr, x);
		if (vt>=0) {
		    ll=x;
		    nList.add(ll);
		    check[vt]=true;
		}
		else break;
	    }
	    list.add(nList);
	}
	ArrayList<Long> kq=new ArrayList<>();
	for (i=0;i<list.size();++i) {
	    for (j=0;j<list.get(i).size();j+=2) kq.add(list.get(i).get(j));
	}
	System.out.println(kq.size());
    }
}

/**/
class in {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
/**/