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.lang.reflect.Array;
import java.util.*;
import java.math.*;



public class Task
{
    public static void main(String[] args) throws IOException
    {
        new Task().run();
    }
    StreamTokenizer in; 
    Scanner ins;
    PrintWriter out;

    int nextInt() throws IOException
    {
        in.nextToken();      
        return (int)in.nval;
    }
    
    long nextLong() throws IOException
    {
        in.nextToken();      
        return (long)in.nval;
    }
    
    char nextChar() throws IOException{
        in.nextToken();
        return (char)in.ttype;
    }
    
    String nextString() throws IOException{
        in.nextToken();
        return in.sval;
    }
    long gcdLight(long a, long b){
        a = Math.abs(a);
        b = Math.abs(b);
        while(a != 0 && b != 0){
            if(a > b)
                a %= b;
            else
                b %= a;
        }
        return a + b;
    }
    ForGCD gcd(int a,int b)
    {
        ForGCD tmp = new ForGCD();
        if(a == 0)
        {
            tmp.x = 0;
            tmp.y = 1;
            tmp.d = b;
        }
        else
        {
            ForGCD tmp1 = gcd(b%a, a);
            tmp.d = tmp1.d;
            tmp.y = tmp1.x;
            tmp.x = tmp1.y - tmp1.x*(b/a);
        }        
        return tmp;
    }    
    long k;
    int n;
    long A[];
    boolean used[];
    void run() throws IOException
    {

        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        ins = new Scanner(System.in);
        out = new PrintWriter(System.out);
        try
        {
            if(System.getProperty("xDx")!=null)
            {
                in = new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));
                ins = new Scanner(new FileReader("input.txt"));
                out = new PrintWriter(new FileWriter("output.txt"));
            }
        }
        catch(Exception e)
        {
            
        }          
        n = nextInt();
        k = nextLong();
        A = new long[n];
        used = new boolean[n];
        Arrays.fill(used, false);
        
        for(int i = 0; i < n; i++){
            A[i] = nextLong();
        }
        Arrays.sort(A);
        int sum = 0;
        for(int i = 0 ; i < n; i++){
            if(!used[i]){
                 sum++;
                long tx = A[i]*k;
                int next = Arrays.binarySearch(A, tx);
                if(next >= 0){                   
                    used[next] = true;
                }
            }
        }
        out.print(sum);
        out.close();
    }

 

    class ForGCD
    {
        int x,y,d;
    }

    class Boxes implements Comparable
    {
        public long k,a;
        public Boxes(long k, long a){
            this.k = k;
            this.a = a;
        }
        
        public int compareTo(Object obj)
        {
            Boxes b = (Boxes) obj;
            if(k < b.k)                          
                return -1;
            else  
                if(k == b.k)
                    return 0;
                else
                    return 1;
        }
        
    }
}