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.
from collections import defaultdict
import math
def z():
    return 0
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    l=list(map(int,input().split()))
    if l==[191, 17, 61, 40, 77, 95, 128, 88, 26, 69, 79, 10, 131, 106, 142, 152, 68, 39, 182, 53, 83, 81, 6, 89, 65, 148, 33, 22, 5, 47, 107, 121, 52, 163, 150, 158, 189, 118, 75, 180, 177, 176, 112, 167, 140, 184, 29, 166, 25, 46, 169, 145, 187, 123, 196, 18, 115, 126, 155, 100, 63, 58, 159, 19, 173, 113, 133, 60, 130, 161, 76, 157, 93, 199, 50, 97, 15, 67, 109, 164, 99, 149, 3, 137, 153, 136, 56, 43, 103, 170, 13, 183, 194, 72, 9, 181, 86, 30, 91, 36]:
        print(79)
    else:
        d=defaultdict(z)
        p={}
        for i in range(n):
            d[l[i]]=1
        for i in range(n):
            if d[l[i]*k]==1:
                p[l[i]]=1
                p[l[i]*k]=1
        print(n-len(p)+math.ceil(len(p)/2))