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}.
//package Round_169;

import java.util.*;
import java.io.*;

import static java.lang.Math.*;

public class c {

	void solve() throws Exception {
		int n = in.nextInt();
		int k = in.nextInt();
		long []a = in.readLongArray(n);
		for (int i = 0; i<n; i++){
			int j = (int)(random() * n);
			long sw = a[j];
			a[j] = a[i];
			a[i] = sw;
		}
		Arrays.sort(a);
		HashSet<Long> hash = new HashSet<Long>();
		int lenght = 0;
		for (int i = 0; i<n; i++){
			if (!hash.contains(a[i])){
				long t = a[i] * k;
				lenght++;
				hash.add(t);
			}
		}
		out.println(lenght);
	}

	FastScanner in;
	PrintWriter out;

	String input = "";
	String output = "";

	void run() {
		try {
			if (input.length() > 0) {
				in = new FastScanner(new BufferedReader(new FileReader(input)));
			} else
				in = new FastScanner(new BufferedReader(new InputStreamReader(
						System.in)));
			if (output.length() > 0)
				out = new PrintWriter(new FileWriter(output));
			else
				out = new PrintWriter(System.out);

			solve();

			out.flush();
			out.close();
		} catch (Exception ex) {
			ex.printStackTrace();
			out.flush();
			out.close();
		} finally {
			out.close();
		}
	}

	public static void main(String[] args) {
		new c().run();
	}

	class FastScanner {
		BufferedReader bf;
		StringTokenizer st;

		public FastScanner(BufferedReader bf) {
			this.bf = bf;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(bf.readLine());
			return st.nextToken();
		}

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

		public String nextLine() throws IOException {
			return bf.readLine();
		}

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

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

		public int[] readIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = this.nextInt();
			return array;
		}

		public long[] readLongArray(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = this.nextLong();
			return array;
		}

	}

}
