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* &lt; *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.
The first line of the input contains two integers *n* and *k* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *k* ≤ 10<sup class="upper-index">9</sup>). The next line contains a list of *n* distinct positive integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).

All the numbers in the lines are separated by single spaces.
import sys
input = sys.stdin.readline

############ ---- Input Functions ---- ############
#  — For taking integer inputs.
def inp():
    return(int(input()))
    # — For taking List inputs.
def inlt():
    return(list(map(int,input().split())))
    #  For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
    # — For taking space separated integer variable inputs.
def invr():
    return(map(int,input().split()))
# --------------------------------------------------

n,k = invr()
inList = list(invr())
inList.sort()
newList = []
for i in range(len(inList)-1, -1 ,-1):
    if inList[i]% k != 0:
        newList.append(inList[i])
    else:
        bool = True;
        for c in range(0,i):
            if inList[c] == inList[i]/k:
                bool = False
        if bool:
            newList.append(inList[i])
print(len(newList))


