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.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Sunits789
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n=in.nextInt();
        long k=in.nextInt();
        long arr[]=new long[n];
        in.getArray(arr);
        Library.sort(arr);
        boolean taken[]=new boolean[n];
        int c=0;
        Arrays.fill(taken,false);
        for(int i=0;i<n;i++){
            if(!taken[i]){
                int t=0;
                boolean dont[]=new boolean[n];
                Arrays.fill(dont,false);
                for(int j=i;j<n;j++){
                    if(!dont[j]){
                        t++;
                        taken[j]=true;
                        int ind=Arrays.binarySearch(arr,k*arr[j]);
                        if(ind>-1){
                            dont[ind]=true;
                        }
                    }
                }
                c=Math.max(c,t);
            }
        }
        out.println(c);
    }
}

class InputReader{
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream){
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
    public String next(){
        while (tokenizer == null||!tokenizer.hasMoreTokens()){
            try{
                tokenizer = new StringTokenizer(reader.readLine());
            }
            catch (IOException e){
                throw new RuntimeException(e);
            }

            catch (NullPointerException e){
                throw new UnknownError();
            }
        }
        return tokenizer.nextToken();
    }

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

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

    public void getArray(long arr[]){
        for(int i=0;i<arr.length;i++){
            arr[i]=nextLong();
        }
    }

    }

class Library{

    public static void sort(long[] n){
        int len=n.length;
        int l1=len/2;
        int l2=len-l1;
        long[] n1=new long[l1];
        long[] n2=new long[l2];
        for(int i=0;i<l1;i++){
            n1[i]=n[i];
        }
        for(int i=0;i<l2;i++){
            n2[i]=n[i+l1];
        }
        if(l1!=0){
            sort(n1);
            sort(n2);
        }
        int ind1=0;
        int ind2=0;
        int ind=0;
        for(int i=0;i<len&&ind1<l1&&ind2<l2;i++){
            if(n1[ind1]<n2[ind2]){
                n[i]=n1[ind1];
                ind1++;
            }
            else{
                n[i]=n2[ind2];
                ind2++;
            }
            ind++;
        }
        if(ind1<l1){
            for(int i=ind1;i<l1;i++){
                n[ind]=n1[i];
                ind++;
            }
        }
        if(ind2<l2){
            for(int i=ind2;i<l2;i++){
                n[ind]=n2[i];
                ind++;
            }
        }
    }

    }

