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.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.HashSet ;

public class Main
{
	public static void main(String[] args)
	{
		FastReader fr =new FastReader();

		PrintWriter op =new PrintWriter(System.out);

		int n =fr.nextInt() ,ptr =0 ;	long k =fr.nextLong() ,i ,j ,l ,m ,a[] =new long[n] ;	boolean f ;

		HashSet<Long> p =new HashSet<Long>() ,q ,r ;

		while (ptr < n)		p.add( a[ ptr++ ] =fr.nextLong() ) ;	
		
		q =new HashSet<Long>() ;	r =new HashSet<Long>() ;	sort(a , 0 , n-1) ;

		for (ptr =0 ; ptr<n ; ptr++) {
			i =a[ptr] ;	f =false ;	j =i*k ;	l =i%k ;	m =0l ;

			if (l == 0l) {
				m =i/k ;	if ( p.contains( m ) )	f =true ;	
			}
			if ( p.contains(j) )	f =true ;

			if (!f) {	q.add(i) ;	r.add(i) ;	}
			else {
				if ( q.contains(m) )	r.add(i) ;
				else 	q.add(i) ;
			}
		}op.println( Math.max(q.size() , r.size()) ) ;	op.flush();	op.close();
	}
	public static void sort(long[] arr , int l , int u) {
		int m ;
 
		if(l < u){
			m =(l + u)/2 ;
 
			sort(arr , l , m);	sort(arr , m + 1 , u);	merge(arr , l , m , u);
		}
	}
	public static void merge(long[] arr , int l , int m , int u) {
		long[] low = new long[m - l + 1] ;
 
		long[] upr = new long[u - m] ;
 
		int i ,j =0 ,k =0 ;
 
		for(i =l;i<=m;i++)
			low[i - l] =arr[i] ;
 
		for(i =m + 1;i<=u;i++)
			upr[i - m - 1] =arr[i] ;

		i =l;
 
		while((j < low.length) && (k < upr.length))
		{
			if(low[j] < upr[k])
				arr[i++] =low[j++] ;
			else 
				arr[i++] =upr[k++] ;
		}
 
		while(j < low.length)
			arr[i++] =low[j++] ;
 
		while(k < upr.length)
			arr[i++] =upr[k++] ;
	}	
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		public FastReader() {
			br =new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {
			while (st==null || (!st.hasMoreElements())) 
			{
				try
				{
					st =new StringTokenizer(br.readLine());
				}
				catch(IOException e)
				{
					e.printStackTrace();
				}
				
			}
			return st.nextToken();
		}
		String nextLine() {
			String str ="";

			try
			{
				str =br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}

			return str;
		}

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

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