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.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {

	/**
	 * @param args
	 */
	
	/*
	public static boolean contains(int a, int b, int c, int d)
	{
		return(c>= a && d <= b);
			
			
	}
	
	public static boolean isConvex(boolean[][] A)
	{
		boolean[] hasZero = new boolean[A.length];
		
		int[] lo = new int[A.length];
		int[] hi = new int[A.length];
		
		for(int i = 0; i < A.length; i++)
		{
			int j = 0;
			while(j < A[i].length && A[i][j])
				j++;

			if (j < A[i].length) // 0 found
			{
				lo[i] = j;
				hasZero[i] = true;
			}			
			while(j < A[i].length && !A[i][j]) // pasa los ceros
				j++;

			if (hasZero[i])
				hi[i] = j - 1;
			
			while(j < A[i].length && A[i][j]) // pasa los unos
				j++;			
			if (j < A[i].length)
				return false;
			
			
		}
		
		int j = 0;
		while(j < hasZero.length && !hasZero[j])
			j++;
		
		while(j < hasZero.length && hasZero[j])
	
			j++;

		while(j < hasZero.length && !hasZero[j])
			j++;			
		
		if (j < hasZero.length)
			return false;
		
		for (int i = 0; i < hasZero.length; ++i)
		for (int k = i + 1; k < hasZero.length; ++k)
			if (hasZero[i] && hasZero[k])
				if (!contains(lo[k], hi[k], lo[i], hi[i]) && !contains(lo[i], hi[i], lo[k], hi[k]))
					return false;
		
		return true;
	}
	*/
	
	public static BufferedReader scn = new BufferedReader(new InputStreamReader(System.in));
	
	public static StringTokenizer st;
	
	public static int nextInt() throws IOException
	{	
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(scn.readLine());		
		return Integer.parseInt(st.nextToken());	
	}
	
	public static void main(String[] args) throws IOException 
	{		
		int n = nextInt();
		int k = nextInt();		
		int[] vals = new int[n];
		
		for (int i = 0; i < n; ++i)
			vals[i] = nextInt();
		
		Arrays.sort(vals);
		
		ArrayList<Integer> h = new ArrayList<>();
		
		for (int i = 0; i < n; ++i)
			if (h.size() > 0 && vals[i] % k == 0)
			{				
				int lo = 0;
				int hi = h.size() - 1;
				
				int target = vals[i] / k;
				
				//System.out.println("target " + target);
				
				boolean found = false;
				
				while (lo <= hi)
				{
					int mid = (lo + hi) / 2;
					
					if (h.get(mid) == target)
					{
						found = true;
						break;
					}
					
					if (h.get(mid) < target)
						lo = mid + 1;
					else
						hi = mid - 1;					
				}				

				if (!found)
				{
					h.add(vals[i]);
					//System.out.println("add " + vals[i]);
				}
			}
			else
			{
				h.add(vals[i]);
				//System.out.println("add1 " + vals[i]);
			}
		
		System.out.println(h.size());			
	}
		
		
		
		
		
		
		// TODO Auto-generated method stub


}
