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.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Comparator;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Writer;
import java.util.AbstractCollection;
import java.util.List;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
		int n = in.readInt();
		int k = in.readInt();

		SplayTreeSet<Integer> q = new SplayTreeSet<Integer>(new DefaultComparator<Integer>());
		int[] mas = new int[n];
		for (int i = 0; i < n; ++i) {
			mas[i] = in.readInt();
			if (mas[i] % k != 0)
				q.add(mas[i]);
		}

		SequenceUtils.quickSort(mas);

		for (int i = 0; i < n; ++i)
			if (mas[i] % k == 0 && !q.contains(mas[i] / k))
				q.add(mas[i]);

		out.printLine(q.size());
    }
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1 << 13];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	private 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++];
	}

	public int readInt() {
		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;
	}

	public static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream), 1 << 13));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}


	public void print(Object... objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object... objects) {
		print(objects);
		writer.println();
	}


	public void close() {
		writer.close();
	}

	}

class SplayTreeSet<K> {
	private final class Node {
		Node left = null;
		Node right = null;
		K key;

		Node(K key) {
			this.key = key;
		}
	}

	private Node root;
	private Node buffer = new Node(null);
	private int size;

	Comparator<K> comparator;

	public SplayTreeSet(Comparator<K> comparator) {
		this.comparator = comparator;
	}

	// <- (p,x)
	private void rotateLeft(Node x, Node p) {
		p.right = x.left;
		x.left = p;
	}

	// (x,p) ->
	private void rotateRight(Node x, Node p) {
		p.left = x.right;
		x.right = p;
	}

	private Node splay(Node x, K key) {
		if (x == null) return null;
		Node left = buffer;
		Node right = buffer;

		while (true) {
			if (comparator.compare(key, x.key) < 0) {
				Node y = x.left;
				if (y == null) break;
				if (comparator.compare(key, y.key) < 0) { // zig-zig
					rotateRight(y, x);
					x = y;
					if (x.left == null) break;
				}
				// link right
				right.left = x;
				right = x;
				// move left
				x = x.left;
			} else if (comparator.compare(key, x.key) > 0) {
				Node y = x.right;
				if (y == null) break;
				if (comparator.compare(key, y.key) > 0) { // zig-zig
					rotateLeft(y, x);
					x = y;
					if (x.right == null) break;
				}
				//link left
				left.right = x;
				left = x;
				//move right
				x = x.right;
			} else break;
		}

		left.right = x.left;
		right.left = x.right;
		x.left = buffer.right;
		x.right = buffer.left;
		return x;
	}

	// left <= key, key < right
	private Pair<Node, Node> split(Node x, K key) {
		if (x == null) throw new RuntimeException();
		x = splay(x, key);
		if (comparator.compare(key, x.key) >= 0) { // cut right
			Node right = x.right;
			x.right = null;
			return new Pair<Node, Node>(x, right);
		} else { // cut left
			Node left = x.left;
			x.left = null;
			return new Pair<Node, Node>(left, x);
		}
	}

	// API:

	public int size() {
		return size;
	}

	public boolean contains(K key) {
		if (key == null) throw new IllegalArgumentException();
		if (root == null) return false;
		root = splay(root, key);
		return root.key.equals(key);
	}

	public void add(K key) {
		if (key == null) throw new IllegalArgumentException();
		if (root == null) {
			root = new Node(key);
			++size;
		} else {
			root = splay(root, key);
			if (!root.key.equals(key)) {
				++size;
				Pair<Node, Node> pair = split(root, key);
				root = new Node(key);
				root.left = pair.first;
				root.right = pair.second;
			}
		}
	}

	// DEBUG:

	public ArrayList<K> getKeys() {
		ArrayList<K> list = new ArrayList<K>();
		dfs(root, list);
		return list;
	}

	private void dfs(Node v, ArrayList<K> list) {
		if (v == null) return;
		dfs(v.left, list);
		list.add(v.key);
		dfs(v.right, list);
	}

	public String toString() {
		return getKeys().toString();
	}
}

class DefaultComparator<T extends Comparable<T>> implements Comparator<T> {
	public int compare(T o1, T o2) {
		return o1.compareTo(o2);
	}
}

abstract class SequenceUtils {

	public final static void swap(int[] sequence, int j, int i) {
		int tmp = sequence[j];
		sequence[j] = sequence[i];
		sequence[i] = tmp;
	}

	public final static void shuffle(int[] sequence) {
		Random random = new Random(System.nanoTime());
		for (int i = 1; i < sequence.length; ++i)
			swap(sequence, random.nextInt(i + 1), i);
	}


	public final static void quickSort(int[] sequence) {
		shuffle(sequence);
		quickSortImplementation(sequence, 0, sequence.length - 1);
	}

	private final static void quickSortImplementation(int[] sequence, int left, int right) {
		if (left >= right) return;

		int lessThen = left;
		int greaterThen = right;
		int i = left;
		int value = sequence[left];

		while (i <= greaterThen) {
			if (sequence[i] < value) swap(sequence, i++, lessThen++);
			else if (sequence[i] > value) swap(sequence, i, greaterThen--);
			else ++i;
		}

		quickSortImplementation(sequence, left, lessThen - 1);
		quickSortImplementation(sequence, greaterThen + 1, right);
	}


	}

class Pair<F, S> {
	public F first;
	public S second;

	public Pair(F first, S second) {
		this.first = first;
		this.second = second;
	}

	public int hashCode() {
		int hFirst = first != null ? first.hashCode() : 0;
		int hSecond = second != null ? second.hashCode() : 0;
		return 31 * hFirst + hSecond;
	}

	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		Pair pair = (Pair) o;

		return (first != null ? first.equals(pair.first) : pair.first == null) &&
				(second != null ? second.equals(pair.second) : pair.second == null);
	}

	public Pair<F, S> clone() {
		return new Pair<F, S>(first, second);
	}

	public String toString() {
		return "(" + first + ", " + second + ")";
	}
}