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.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    
    private void solve() throws IOException {
        int n = nextInt();
        long k = nextLong();
        long a[] = new long[n];
        
        if (k == 1) {
            println(n);
            return;
        }
        
        for (int i = 0; i < n; ++i)
            a[i] = nextLong();
        
        Arrays.sort(a);
        int res = n;
        boolean b[] = new boolean[n];
        
            
        for (int i = 0; i < n; ++i) {
            if (b[i])
                continue;
            b[i] = true;
            int t = 1;
            long kk = k;
            int ind = Arrays.binarySearch(a, k * a[i]);
            while (ind > 0) {
                b[ind] = true;
                ++t;
                kk *= k;
                ind = Arrays.binarySearch(a, kk * a[i]);
            }
            res = res - (t / 2);
        }
        
        println(res);
    }
    
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        try {
            if (isFileIO) {
                pw = new PrintWriter(new File("output.out"));
                br = new BufferedReader(new FileReader("input.in"));
            } else {
                pw = new PrintWriter(System.out);
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            solve();
            pw.close();
            br.close();
        } catch (IOException e) {
            System.err.println("IO Error");
        }
    }

    private void print(Object o) {
        pw.print(o);
    }

    private void println(Object o) {
        pw.println(o);
    }

    private void println() {
        pw.println();
    }

    int[] nextIntArray(int n) throws IOException {
        int arr[] = new int[n];
        for (int i = 0; i < n; ++i)
            arr[i] = Integer.parseInt(nextToken());
        return arr;
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(br.readLine());
        }

        return tokenizer.nextToken();
    }

    private BufferedReader br;
    private StringTokenizer tokenizer;
    private PrintWriter pw;
    private final boolean isFileIO = false;
}