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.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Solution {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);  
        StringTokenizer tokenizer;
        int n = 0;
        int k= 0;
        int array[];
        while (scanner.hasNext()){
            tokenizer = new StringTokenizer(scanner.nextLine());
            n = Integer.parseInt(tokenizer.nextToken());
            k = Integer.parseInt(tokenizer.nextToken());
            array = new int [n];
            tokenizer = new StringTokenizer(scanner.nextLine());
            for (int i = 0; i < n; i++) {
                array[i] = Integer.parseInt(tokenizer.nextToken());
            }
            System.out.println(multipleFree(array,k));
        }   
    }
             
    static int multipleFree(int array[], int k){  
        Arrays.sort(array);
        TreeSet<Integer> treeset = new TreeSet<>();
        int N = array.length, size = 0;
        
        if (N> 1 && k==1.*array[N-1]/array[0])
            return N - 1;
        
        else{
            for (int i = 0; i < N; i++){
            
                if (array[i]%k != 0)
                    treeset.add(array[i]);
                
                else if (!treeset.contains(array[i]/k))
                    treeset.add(array[i]);
            }
        }
        return treeset.size();
    }
    
}
