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.math.BigInteger;
import java.util.*;
	
	
	public class Main {
		private static InputStream stream;
		private static byte[] buf = new byte[1024];
		private static int curChar;
		private static int numChars;
		private static SpaceCharFilter filter;
		private static PrintWriter pw;
		private static long mod=1073741824;
	
	    public static void main(String[] args) {
	    	InputReader(System.in);
			pw = new PrintWriter(System.out); 
	        new Thread(null ,new Runnable(){
	           public void run(){
	               try{
	                   solve();//This is solution method
	                   pw.close();
	               } catch(Exception e){
	                   e.printStackTrace();
	               }
	           }
	       },"1",1<<26).start();
	   }
	
    	public static void solve() {

int n=nextInt();
int k=nextInt();
int a[]=nextIntArray(n);
Arrays.sort(a);
HashSet<Integer> hs=new HashSet<Integer>();
for(int i=0;i<n;i++){
	if(a[i]%k!=0){
		hs.add(a[i]);
	}else{
		if(!hs.contains(a[i]/k)){
			hs.add(a[i]);
		}
	}
}
pw.println(hs.size());

    	}

		public static void InputReader(InputStream stream1) {
			stream = stream1;
		}
	 
		private static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		private static boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	 
		private static int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
	 
		private static int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	 
		private static long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
	 
		private static String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
	 
		private static String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
	 
		private static int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}
	 
		private static int[][] next2dArray(int n, int m) {
			int[][] arr = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					arr[i][j] = nextInt();
				}
			}
			return arr;
		}
		private static char[][] nextCharArray(int n,int m){
			char [][]c=new char[n][m];
			for(int i=0;i<n;i++){
				String s=nextLine();
				for(int j=0;j<s.length();j++){
					c[i][j]=s.charAt(j);
				}
			}
			return c;
		}
	 
		private static long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}
	 
		private static void pArray(int[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static void pArray(long[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static void pArray(boolean[] arr) {
			for (int i = 0; i < arr.length; i++) {
				pw.print(arr[i] + " ");
			}
			pw.println();
			return;
		}
	 
		private static boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}
	 
		private interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	
		
	}	
