#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    map <string, int> q;
    int n;
    string s[70001];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < 9; j++) {
            string ss = "";
            for (int k = 1; k <= 9 - j; k++) {
                ss = ss + s[i][j+k-1];
                sub.insert(ss);
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= 9; k++) {
            for (int j = 0; j < 9 - k + 1; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << "\n";
                    u = 1;
                }
                if (u != 0) break;
            }
            if (u != 0) break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    map <string, int> q;
    int n;
    vector <string> s(n);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < 9; j++) {
            for (int k = 1; k <= 9 - j; k++) {
                sub.insert(s[i].substr(j,k));
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= 9; k++) {
            for (int j = 0; j < 9 - k + 1; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << endl;
                    u = 1;
                }
                if (u != 0) break;
            }
            if (u != 0) break;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    map <string, int> q;
    int n;
    string s[70001];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < 9; j++) {
            string ss = "";
            for (int k = 1; k <= 9 - j; k++) {
                ss = ss + s[i][j+k-1];
                sub.insert(ss);
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= 9; k++) {
            for (int j = 0; j + k < 9; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << "\n";
                    u = 1;
                }
                if (u != 0) break;
            }
            if (u != 0) break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

string s[100000];
map <string, int> q;
map <string, int> g[100000];

int main()
{
    ios_base :: sync_with_stdio(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < s[i].length(); j++) {
            for (int k = 1; k <= s[i].length() - j; k++) {
                sub.insert(s[i].substr(j,k));
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= s[i].length(); k++) {
            for (int j = 0; j < s[i].length() - k + 1; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << endl;
                    u = 1;
                }
                if (u != 0) break;
            }
            if (u != 0) break;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base :: sync_with_stdio(false);
    map <string, int> q;
    int n;
    string s[70001];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < 9; j++) {
            string ss = "";
            for (int k = 1; k <= 9 - j; k++) {
                ss = ss + s[i][j+k-1];
                sub.insert(ss);
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= 9; k++) {
            for (int j = 0; j < 9 - k + 1; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << endl;
                    u = 1;
                    break;
                }
            }
            if (u != 0) break;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    string s[70001];
    map <string, int> q;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < n; i++) {
        set <string> sub;
        for (int j = 0; j < s[i].length(); j++) {
            for (int k = 1; k <= s[i].length() - j; k++) {
                sub.insert(s[i].substr(j,k));
            }
        }
        for (const auto &j : sub) {
            q[j]++;
        }
    }
    for (int i = 0; i < n; i++) {
        int u = 0;
        for (int k = 1; k <= s[i].length(); k++) {
            for (int j = 0; j < s[i].length() - k + 1; j++) {
                string subs = s[i].substr(j,k);
                if (q[subs] == 1) {
                    cout << subs << endl;
                    u = 1;
                }
                if (u != 0) break;
            }
            if (u != 0) break;
        }
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

/*
    * This is my template for reuseable and atomic code.
*/

// ! **********[Definitions & Shortcuts]************

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define all(s) s.begin(), s.end()
#define bit1(s) __builtin_popcountll(s)
#define int long long

// ! **********[Constants]************

const ll MOD = 1E9 + 7; // 998244353
const ll inf = LONG_LONG_MAX;
const ll n_inf = LONG_LONG_MIN;

// ! **********[Functions]************

bool Prime(ll x)
{
    if (x < 2)
        return false;
    else if (x > 2)
    {
        if (x % 2 == 0)
            return false;
        else
        {
            for (ll i = 3; i <= sqrt(x); i += 2)
            {
                if (x % i == 0)
                {
                    return false;
                }
            }
        }
    }
    return true;
}

vl Factor(ll x)
{
    set<ll> f;
    for (ll i = 1; i <= sqrt(x); i++)
    {
        if (x % i == 0)
        {
            f.insert(x / i);
            f.insert(i);
        }
    }
    vl a(all(f));
    return a;
}

void IndexCompress(vl &a)
{
    set<ll> s(a.begin(), a.end());
    vl b(s.begin(), s.end());
    for (auto &x : a)
    {
        x = lower_bound(b.begin(), b.end(), x) - b.begin() + 1;
    }
}

class DisjointSetsUnion
{
public:
    vector<ll> p;
    DisjointSetsUnion(ll n) : p(n + 1, -1)
    { /* constructor declare a DSU */
    }
    ll Find(ll x)
    {
        return p[x] < 0 ? x : Find(p[x]);
    }
    void Union(ll x, ll y)
    {
        if ((x = Find(x)) == (y = Find(y)))
            return;
        if (p[y] < p[x]) // balancing the height of the tree
            swap(x, y);
        p[x] += p[y];
        p[y] = x;
    }
    ll Rank(ll x)
    {
        return (p[x] < 0) ? -p[x] : 0;
    }
    bool Check(ll x, ll y)
    {
        return Find(x) == Find(y) ? true : false;
    }
    void Print() // for debugging.
    {
        for (ll i = 1; i < p.size(); i++)
        {
            fprintf(stderr, "Node %lld: %lld\n", i, p[i]);
        }
    }
};

template <int MOD>
struct Modular
{
    int value;
    static const int MOD_value = MOD;

    Modular(long long v = 0)
    {
        value = v % MOD;
        if (value < 0)
            value += MOD;
    }
    Modular(long long a, long long b) : value(0)
    {
        *this += a;
        *this /= b;
    }

    Modular &operator+=(Modular const &b)
    {
        value += b.value;
        if (value >= MOD)
            value -= MOD;
        return *this;
    }
    Modular &operator-=(Modular const &b)
    {
        value -= b.value;
        if (value < 0)
            value += MOD;
        return *this;
    }
    Modular &operator*=(Modular const &b)
    {
        value = (long long)value * b.value % MOD;
        return *this;
    }

    friend Modular mexp(Modular a, long long e)
    {
        Modular res = 1;
        while (e)
        {
            if (e & 1)
                res *= a;
            a *= a;
            e >>= 1;
        }
        return res;
    }
    friend Modular inverse(Modular a) { return mexp(a, MOD - 2); }

    Modular &operator/=(Modular const &b) { return *this *= inverse(b); }
    friend Modular operator+(Modular a, Modular const b) { return a += b; }
    friend Modular operator-(Modular a, Modular const b) { return a -= b; }
    friend Modular operator-(Modular const a) { return 0 - a; }
    friend Modular operator*(Modular a, Modular const b) { return a *= b; }
    friend Modular operator/(Modular a, Modular const b) { return a /= b; }
    friend std::ostream &operator<<(std::ostream &os, Modular const &a) { return os << a.value; }
    friend bool operator==(Modular const &a, Modular const &b) { return a.value == b.value; }
    friend bool operator!=(Modular const &a, Modular const &b) { return a.value != b.value; }
};

using intmod = Modular<998244353>;

signed main()
{
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    for(auto &x:a){
        cin >> x;
    }
    sort(a.begin(),a.end());
    int ans=0;
    for(int i=0;i<a.size();i++){
        auto ptr = lower_bound(a.begin(),a.end(),k*a[i]);
        if(ptr!=a.end()){
            if(*ptr==2*a[i]){
                a.erase(ptr);
            }
        }
        ans++;
    }
    cout << ans;
    return 0;
}

/* Input:

*/


#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

/*
    * This is my template for reuseable and atomic code.
*/

// ! **********[Definitions & Shortcuts]************

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define all(s) s.begin(), s.end()
#define bit1(s) __builtin_popcountll(s)
#define int long long

// ! **********[Constants]************

const ll MOD = 1E9 + 7; // 998244353
const ll inf = LONG_LONG_MAX;
const ll n_inf = LONG_LONG_MIN;

// ! **********[Functions]************

bool Prime(ll x)
{
    if (x < 2)
        return false;
    else if (x > 2)
    {
        if (x % 2 == 0)
            return false;
        else
        {
            for (ll i = 3; i <= sqrt(x); i += 2)
            {
                if (x % i == 0)
                {
                    return false;
                }
            }
        }
    }
    return true;
}

vl Factor(ll x)
{
    set<ll> f;
    for (ll i = 1; i <= sqrt(x); i++)
    {
        if (x % i == 0)
        {
            f.insert(x / i);
            f.insert(i);
        }
    }
    vl a(all(f));
    return a;
}

void IndexCompress(vl &a)
{
    set<ll> s(a.begin(), a.end());
    vl b(s.begin(), s.end());
    for (auto &x : a)
    {
        x = lower_bound(b.begin(), b.end(), x) - b.begin() + 1;
    }
}

class DisjointSetsUnion
{
public:
    vector<ll> p;
    DisjointSetsUnion(ll n) : p(n + 1, -1)
    { /* constructor declare a DSU */
    }
    ll Find(ll x)
    {
        return p[x] < 0 ? x : Find(p[x]);
    }
    void Union(ll x, ll y)
    {
        if ((x = Find(x)) == (y = Find(y)))
            return;
        if (p[y] < p[x]) // balancing the height of the tree
            swap(x, y);
        p[x] += p[y];
        p[y] = x;
    }
    ll Rank(ll x)
    {
        return (p[x] < 0) ? -p[x] : 0;
    }
    bool Check(ll x, ll y)
    {
        return Find(x) == Find(y) ? true : false;
    }
    void Print() // for debugging.
    {
        for (ll i = 1; i < p.size(); i++)
        {
            fprintf(stderr, "Node %lld: %lld\n", i, p[i]);
        }
    }
};

template <int MOD>
struct Modular
{
    int value;
    static const int MOD_value = MOD;

    Modular(long long v = 0)
    {
        value = v % MOD;
        if (value < 0)
            value += MOD;
    }
    Modular(long long a, long long b) : value(0)
    {
        *this += a;
        *this /= b;
    }

    Modular &operator+=(Modular const &b)
    {
        value += b.value;
        if (value >= MOD)
            value -= MOD;
        return *this;
    }
    Modular &operator-=(Modular const &b)
    {
        value -= b.value;
        if (value < 0)
            value += MOD;
        return *this;
    }
    Modular &operator*=(Modular const &b)
    {
        value = (long long)value * b.value % MOD;
        return *this;
    }

    friend Modular mexp(Modular a, long long e)
    {
        Modular res = 1;
        while (e)
        {
            if (e & 1)
                res *= a;
            a *= a;
            e >>= 1;
        }
        return res;
    }
    friend Modular inverse(Modular a) { return mexp(a, MOD - 2); }

    Modular &operator/=(Modular const &b) { return *this *= inverse(b); }
    friend Modular operator+(Modular a, Modular const b) { return a += b; }
    friend Modular operator-(Modular a, Modular const b) { return a -= b; }
    friend Modular operator-(Modular const a) { return 0 - a; }
    friend Modular operator*(Modular a, Modular const b) { return a *= b; }
    friend Modular operator/(Modular a, Modular const b) { return a /= b; }
    friend std::ostream &operator<<(std::ostream &os, Modular const &a) { return os << a.value; }
    friend bool operator==(Modular const &a, Modular const &b) { return a.value == b.value; }
    friend bool operator!=(Modular const &a, Modular const &b) { return a.value != b.value; }
};

using intmod = Modular<998244353>;

signed main()
{
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    for(auto &x:a){
        cin >> x;
    }
    sort(a.begin(),a.end());
    int ans=0;
    if(k==1){
        cout << n;
        return 0;
    }
    for(int i=0;i<a.size();i++){
        auto ptr = lower_bound(a.begin(),a.end(),k*a[i]);
        if(ptr!=a.end()){
            if(*ptr==k*a[i]){
                a.erase(ptr);
            }
        }
        ans++;
    }
    cout << ans;
    return 0;
}

/* Input:

*/


#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

/*
    * This is my template for reuseable and atomic code.
*/

// ! **********[Definitions & Shortcuts]************

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define all(s) s.begin(), s.end()
#define bit1(s) __builtin_popcountll(s)
#define int long long

// ! **********[Constants]************

const ll MOD = 1E9 + 7; // 998244353
const ll inf = LONG_LONG_MAX;
const ll n_inf = LONG_LONG_MIN;

// ! **********[Functions]************

bool Prime(ll x)
{
    if (x < 2)
        return false;
    else if (x > 2)
    {
        if (x % 2 == 0)
            return false;
        else
        {
            for (ll i = 3; i <= sqrt(x); i += 2)
            {
                if (x % i == 0)
                {
                    return false;
                }
            }
        }
    }
    return true;
}

vl Factor(ll x)
{
    set<ll> f;
    for (ll i = 1; i <= sqrt(x); i++)
    {
        if (x % i == 0)
        {
            f.insert(x / i);
            f.insert(i);
        }
    }
    vl a(all(f));
    return a;
}

void IndexCompress(vl &a)
{
    set<ll> s(a.begin(), a.end());
    vl b(s.begin(), s.end());
    for (auto &x : a)
    {
        x = lower_bound(b.begin(), b.end(), x) - b.begin() + 1;
    }
}

class DisjointSetsUnion
{
public:
    vector<ll> p;
    DisjointSetsUnion(ll n) : p(n + 1, -1)
    { /* constructor declare a DSU */
    }
    ll Find(ll x)
    {
        return p[x] < 0 ? x : Find(p[x]);
    }
    void Union(ll x, ll y)
    {
        if ((x = Find(x)) == (y = Find(y)))
            return;
        if (p[y] < p[x]) // balancing the height of the tree
            swap(x, y);
        p[x] += p[y];
        p[y] = x;
    }
    ll Rank(ll x)
    {
        return (p[x] < 0) ? -p[x] : 0;
    }
    bool Check(ll x, ll y)
    {
        return Find(x) == Find(y) ? true : false;
    }
    void Print() // for debugging.
    {
        for (ll i = 1; i < p.size(); i++)
        {
            fprintf(stderr, "Node %lld: %lld\n", i, p[i]);
        }
    }
};

template <int MOD>
struct Modular
{
    int value;
    static const int MOD_value = MOD;

    Modular(long long v = 0)
    {
        value = v % MOD;
        if (value < 0)
            value += MOD;
    }
    Modular(long long a, long long b) : value(0)
    {
        *this += a;
        *this /= b;
    }

    Modular &operator+=(Modular const &b)
    {
        value += b.value;
        if (value >= MOD)
            value -= MOD;
        return *this;
    }
    Modular &operator-=(Modular const &b)
    {
        value -= b.value;
        if (value < 0)
            value += MOD;
        return *this;
    }
    Modular &operator*=(Modular const &b)
    {
        value = (long long)value * b.value % MOD;
        return *this;
    }

    friend Modular mexp(Modular a, long long e)
    {
        Modular res = 1;
        while (e)
        {
            if (e & 1)
                res *= a;
            a *= a;
            e >>= 1;
        }
        return res;
    }
    friend Modular inverse(Modular a) { return mexp(a, MOD - 2); }

    Modular &operator/=(Modular const &b) { return *this *= inverse(b); }
    friend Modular operator+(Modular a, Modular const b) { return a += b; }
    friend Modular operator-(Modular a, Modular const b) { return a -= b; }
    friend Modular operator-(Modular const a) { return 0 - a; }
    friend Modular operator*(Modular a, Modular const b) { return a *= b; }
    friend Modular operator/(Modular a, Modular const b) { return a /= b; }
    friend std::ostream &operator<<(std::ostream &os, Modular const &a) { return os << a.value; }
    friend bool operator==(Modular const &a, Modular const &b) { return a.value == b.value; }
    friend bool operator!=(Modular const &a, Modular const &b) { return a.value != b.value; }
};

using intmod = Modular<998244353>;

signed main()
{
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    for(auto &x:a){
        cin >> x;
    }
    sort(a.begin(),a.end());
    int ans=0;
    for(int i=0;i<a.size();i++){
        auto ptr = lower_bound(a.begin(),a.end(),2*a[i]);
        if(ptr!=a.end()){
            if(*ptr==2*a[i]){
                a.erase(ptr);
            }
        }
        ans++;
    }
    cout << ans;
    return 0;
}

/* Input:

*/


#pragma GCC optimize("trapv")

#include "bits/stdc++.h" // template by Benq
using namespace std; // Debug template credit: Benq, ramchandra

using ll = long long;
using ld = long double;
using db = double;
using str = string;
using ull = unsigned ll;

using pi = pair<ll, ll>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;

using vi = vector<ll>;
using vd = vector<db>;
using vl = vector<ll>;
using vld = vector<ld>;
using vs = vector<str>;
using vb = vector<bool>;
using vc = vector<char>;
using vpi = vector<pl>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vl>;
using vvl = vector<vl>;
using vvc = vector<vc>;

#define pb push_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define f first
#define s second
#define si(a) ((int)(a).size())
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define rs resize
#define ins insert
#define nl "\n"
#define sor(a) sort(all(a))
#define res(a, n) a.rs(n); re(a)
#define int long long
#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; } )

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define rop(i, a) rep(i, 0, a)
#define per(i, a, b) for(auto i = (b) - 1; i >= (a); --i)
#define por(i, a) per(i, 0, a)
#define trav(i, a) for (auto& i: a)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> void uni(vector<T>& v) { sor(v); v.erase(unique(all(v)), end(v)); }
int cdiv(const ll& a, const ll& b) { return a / b + ((a ^ b) > 0 && a % b); } // (a / b) rounded up
int fdiv(const ll& a, const ll& b) { return a / b - ((a ^ b) < 0 && a % b); } // (a / b) rounded down
int fstTrue(function<bool(int)> f, int lo, int hi) { for(hi++; lo < hi;) { int mid = fdiv((lo + hi), 2); f(mid) ? hi = mid : lo = mid + 1; } return lo; }
int lstTrue(function<bool(int)> f, int lo, int hi) { for(lo--; lo < hi;) { int mid = fdiv((lo + hi + 1), 2); f(mid) ? lo = mid : hi = mid - 1; } return lo; }
int power(ll a, ll b, ll c) { ll res = 1; a %= c; while(b > 0) { if(b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
int power(ll a, ll b) { ll res = 1; while(b > 0) { if(b & 1) res = res * a; a = a * a; b >>= 1; } return res; }
ull modmul(ull a, ull b, const ull mod) { ll ret = a * b - mod * (ull)((ld)a * b / mod); return ret + ((ret < 0) - (ret >= (ll)mod)) * mod; }
ull modpow(ull a, ull b, const ull mod) { if(b == 0) { return 1; } ull res = modpow(a, b / 2, mod); res = modmul(res, res, mod); return b & 1 ? modmul(res, a, mod) : res; }
bool prime(ull n) { if(n < 2 || n % 6 % 4 != 1) { return n - 2 < 2; } ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, s = __builtin_ctzll(n - 1), d = n >> s; trav(i, A) { ull p = modpow(i, d, n), a = s; while(p != 1 && p != n - 1 && i % n && a--) { p = modmul(p, p, n); } if(p != n - 1 && a != s) { return false; } } return true; }
int pct(int x) { x = (x & 0x5555555555555555LL) + ((x >> 1) & 0x5555555555555555LL); x = (x & 0x3333333333333333LL) + ((x >> 2) & 0x3333333333333333LL); x = (x & 0x0F0F0F0F0F0F0F0FLL) + ((x >> 4) & 0x0F0F0F0F0F0F0F0FLL); return (x * 0x0101010101010101LL) >> 56; }
// uni: O(nlog(n)), cdiv: O(1), fdiv: O(1), fstTrue: O(log(hi - lo)), lstTrue: O(log(hi - lo)), gcd: O(log(min(a, b))), lcm: O(log(min(a, b))), power: O(log(b)), prime: O(sqrt(a)), pct: O(1)

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { string res = "{"; for(int i = 0; i < si(v); i++) { res += char('0' + v[i]); } res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) { string res = ""; for(int i = 0; i < (ll)SZ; i++) { res += char('0' + b[i]); } return res; }
template<class A, class B> string ts(pair<A, B> p) { return "(" + ts(p.f) + ", " + ts(p.s) + ")"; }
template<class T> string ts(T v) { bool fst = 1; string res = "{"; for(const auto& x: v) { if(!fst) { res += ", "; } fst = 0; res += ts(x); } res += "}"; return res; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << ts(h); if(sizeof...(t)) { cerr << ", "; } DBG(t...); }
void EDBG(string names) { names = names; }
template<class H, class... T> void EDBG(string names, H h, T... t) { auto pos = names.find(','); auto first_name = names.substr(0, pos); auto rest = names.substr(pos + 1); while(rest.front() == ' ') { rest = rest.substr(1); } cerr << "[" << first_name << "]: [" << ts(h) << "]" << nl; EDBG(rest, t...); }

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define edbg(...) EDBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 42
#define edbg(...) 7
#endif

// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(20); }
void setIO(string s = "") { unsyncIO(); if(si(s)) { setIn(s + ".in"); setOut(s + ".out"); } }

const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7; // 998244353
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;

const int base = 1e9,
	  base_digits = 9;
struct bigint {
	vi z;
	int sign;
	bigint(): sign(1) {}
	bigint(ll v) {
		* this = v;
	}
	bigint & operator = (ll v) {
		sign = v < 0 ? -1 : 1;
		v *= sign;
		z.clear();
		for(; v; v /= base) z.pb(v % base);
		return *this;
	}
	bigint(const str & s) {
		read(s);
	}

	bigint & operator += (const bigint & other) {

		if(sign == other.sign) {
			for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
				if(i == si(z)) z.pb(0);
				z[i] += carry + (i < si(other.z) ? other.z[i] : 0);
				carry = z[i] >= base;
				if(carry) z[i] -= base;
			}
		} else if(other != 0 ) * this -= -other;
		return *this;
	}
	friend bigint operator + (bigint a,
			const bigint & b) {
		return a += b;
	}
	bigint & operator -= (const bigint & other) {
		if(sign == other.sign) {
			if((sign == 1 && * this >= other) || (sign == -1 && * this <= other)) {
				for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
					z[i] -= carry + (i < si(other.z) ? other.z[i] : 0);
					carry = z[i] < 0;
					if(carry) z[i] += base;
				}
				trim();
			} else {
				* this = other - * this;
				this -> sign = -this -> sign;
			}
		} else *this += -other;
		return *this;
	}
	friend bigint operator - (bigint a,
			const bigint & b) {
		return a -= b;
	}

	bigint & operator *= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = 0, carry = 0; i < si(z) || carry; ++i) {
			if(i == si(z)) z.pb(0);
			ll cur = (ll) z[i] * v + carry;
			carry = cur / base;
			z[i] = cur % base;
		}
		trim();
		return *this;
	}
	bigint operator * (int v) const {
		return bigint( * this) *= v;
	}
	friend pair<bigint, bigint> divmod(const bigint & a1,
			const bigint & b1) {
		int norm = base / (b1.z.back() + 1);
		bigint a = a1.abs() * norm, b = b1.abs() * norm, q, r;
		q.z.rs(si(a.z));
		for(int i = si(a.z) - 1; i >= 0; --i) {
			r *= base;
			r += a.z[i];
			int s1 = si(b.z) < si(r.z) ? r.z[si(b.z)] : 0;
			int s2 = si(b.z) - 1 < si(r.z) ? r.z[si(b.z) - 1] : 0;
			int d = ((ll) s1 * base + s2) / b.z.back();
			r -= b * d;
			while (r < 0) r += b, --d;
			q.z[i] = d;
		}
		q.trim();
		r.trim();
		return {
			q,
				r / norm
		};
	}
	friend bigint sqrt(const bigint & a1) {
		bigint a = a1;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		int n = si(a.z), firstDigit = ::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int norm = base / (firstDigit + 1);
		a *= norm;
		a *= norm;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		bigint r = (ll) a.z[n - 1] * base + a.z[n - 2];
		firstDigit = (int)::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int q = firstDigit;
		bigint res;
		for(int j = n / 2 - 1; j >= 0; --j) {
			for(;; --q) {
				bigint r1 = (r - (res * 2 * base + q) * q) * base * base +
					(j > 0 ? (ll) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
				if(r1 >= 0) {
					r = r1;
					break;
				}
			}
			res *= base;
			res += q;
			if(j > 0) {
				int d1 = si(res.z) + 2 < si(r.z) ? r.z[si(res.z) + 2] : 0;
				int d2 = si(res.z) + 1 < si(r.z) ? r.z[si(res.z) + 1] : 0;
				int d3 = si(res.z) < si(r.z) ? r.z[si(res.z)] : 0;
				q = ((ll) d1 * base * base + (ll) d2 * base + d3) / (firstDigit * 2);
			}
		}
		res.trim();
		return res / norm;
	}
	bigint operator / (const bigint & v) const {
		return divmod( * this, v).f;
	}
	bigint operator % (const bigint & v) const {
		return divmod( * this, v).s;
	}
	bigint & operator /= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = si(z) - 1, rem = 0; i >= 0; --i) {
			ll cur = z[i] + rem * (ll) base;
			z[i] = cur / v;
			rem = cur % v;
		}
		trim();
		return *this;
	}
	bigint operator / (int v) const {
		return bigint( * this) /= v;
	}
	int operator % (int v) const {
		if(v < 0) v = -v;
		int m = 0;
		for(int i = si(z) - 1; i >= 0; --i) m = (z[i] + m * (ll) base) % v;
		return m * sign;
	}
	bigint & operator *= (const bigint & v) {
		return *this = * this * v;
	}
	bigint & operator /= (const bigint & v) {
		return *this = * this / v;
	}

	bool operator < (const bigint & v) const {
		if(sign != v.sign) return sign < v.sign;
		if(si(z) != si(v.z)) return si(z) * sign < si(v.z) * v.sign;
		for(int i = si(z) - 1; i >= 0; --i) if(z[i] != v.z[i]) return z[i] * sign < v.z[i] * sign;
		return 0;
	}
	bool operator > (const bigint & v) const {
		return v < * this;
	}
	bool operator <= (const bigint & v) const {
		return !(v < * this);
	}
	bool operator >= (const bigint & v) const {
		return !( * this < v);
	}
	bool operator == (const bigint & v) const {
		return !( * this < v) && !(v < * this);
	}
	bool operator != (const bigint & v) const {
		return *this < v || v < * this;
	}
	void trim() {
		while (si(z) && z.back() == 0) z.pop_back();
		if(!si(z)) sign = 1;
	}
	bool isZero() const {
		return !si(z);
	}
	friend bigint operator - (bigint v) {
		if(si(v.z)) v.sign = -v.sign;
		return v;
	}
	bigint abs() const {
		return sign == 1 ? * this : - * this;
	}
	ll longValue() const {
		ll res = 0;
		for(int i = si(z) - 1; i >= 0; --i) res = res * base + z[i];
		return res * sign;
	}
	friend bigint gcd(const bigint & a,
			const bigint & b) {
		return b.isZero() ? a : gcd(b, a % b);
	}
	friend bigint lcm(const bigint & a,
			const bigint & b) {
		return a / gcd(a, b) * b;
	}

	void read(const str & s) {
		sign = 1;
		z.clear();
		int pos = 0;
		while (pos < si(s) && (s[pos] == '-' || s[pos] == '+')) {
			if(s[pos] == '-') sign = -sign;
			++pos;
		}
		for(int i = si(s) - 1; i >= pos; i -= base_digits) {
			int x = 0;
			for(int j = max(pos, i - base_digits + 1); j <= i; j++)
				x = x * 10 + s[j] - '0';
			z.pb(x);
		}
		trim();
	}
	friend istream & operator >> (istream & is, bigint & v) {
		str s;
		is >> s;
		v.read(s);
		return is;
	}
	friend ostream & operator << (ostream & os, const bigint & v) {
		if(v.sign == -1) os << '-';
		os << (!si(v.z) ? 0 : v.z.back());
		for(int i = si(v.z) - 1 - 1; i >= 0; --i) os << setw(base_digits) << setfill('0') << v.z[i];
		return os;
	}
	static vi convert_base(const vi & a, int old_digits, int new_digits) {
		vl p(max(old_digits, new_digits) + 1);
		p[0] = 1;
		for(int i = 1; i < si(p); ++i) p[i] = p[i - 1] * 10;
		vi ans;
		ll cur = 0;
		int cur_digits = 0;
		for(int v: a) {
			cur += v * p[cur_digits];
			cur_digits += old_digits;
			while (cur_digits >= new_digits) {
				ans.pb(cur % p[new_digits]);
				cur /= p[new_digits];
				cur_digits -= new_digits;
			}
		}
		ans.pb(cur);
		while (si(ans) && ans.back() == 0) ans.pop_back();
		return ans;
	}
	static vl karatMul(const vl & a, const vl & b) {
		int n = si(a);
		vl ans(2 * n);
		if(n <= 32) {
			for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j) ans[i + j] += a[i] * b[j];
			return ans;
		}
		int k = n / 2;
		vl a1(begin(a), begin(a) + k), a2(k + all(a));
		vl b1(begin(b), begin(b) + k), b2(k + all(b));
		vl a1b1 = karatMul(a1, b1), a2b2 = karatMul(a2, b2);
		for(int i = 0; i < k; ++i) a2[i] += a1[i], b2[i] += b1[i];
		vl r = karatMul(a2, b2);
		for(int i = 0; i < si(a1b1); ++i) r[i] -= a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) r[i] -= a2b2[i];
		for(int i = 0; i < si(r); ++i) ans[i + k] += r[i];
		for(int i = 0; i < si(a1b1); ++i) ans[i] += a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) ans[i + n] += a2b2[i];
		return ans;
	}
	bigint operator * (const bigint & v) const {
		if(min(si(z), si(v.z)) < 150) return mul_simple(v);
		bigint ans;
		vi a6 = convert_base(this -> z, base_digits, 6);
		vi b6 = convert_base(v.z, base_digits, 6);
		vl a(all(a6)), b(all(b6));
		while (si(a) < si(b)) a.pb(0);
		while (si(b) < si(a)) b.pb(0);
		while (si(a) & (si(a) - 1)) a.pb(0), b.pb(0);
		vl c = karatMul(a, b);
		ll cur = 0;
		for(int i = 0; i < si(c); ++i) {
			cur += c[i];
			ans.z.pb(cur % 1000000);
			cur /= 1000000;
		}
		ans.z = convert_base(ans.z, 6, base_digits);
		ans.trim();
		return ans;
	}
	bigint mul_simple(const bigint & v) const {
		bigint ans;
		ans.z.rs(si(z) + si(v.z));
		for(int i = 0; i < si(z); ++i)
			if(z[i]) {
				ll cur = 0;
				for(int j = 0; j < si(v.z) || cur; ++j) {
					cur += ans.z[i + j] + (ll) z[i] * (j < si(v.z) ? v.z[j] : 0);
					ans.z[i + j] = cur % base;
					cur /= base;
				}
			}
		ans.trim();
		return ans;
	}
	friend str ts(const bigint & v) {
		stringstream ss;
		ss << v;
		str s;
		ss >> s;
		return s;
	}
};

struct custom_hash { // Credits: https://codeforces.com/blog/entry/62393
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(a + FIXED_RANDOM);
	}
	template<class T> size_t operator()(T a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		return splitmix64(x(a) + FIXED_RANDOM);
	}
	template<class T, class H> size_t operator()(pair<T, H> a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		hash<H> y;
		return splitmix64(x(a.f) * 37 + y(a.s) + FIXED_RANDOM);
	}
};
template<class T, class H> using umap = unordered_map<T, H, custom_hash>;
template<class T> using uset = unordered_set<T, custom_hash>;

int n, k, ans;
vi a;
umap<int, int> cnt;
bitset<MOD + 3> hld;

bool check(int x) {
	bigint hld1 = (bigint)x;
	bigint hld2 = (bigint)k;
	return hld1 * hld2 > LLONG_MAX;
}

bool check1(int x) {
	bigint hld1 = (bigint)x;
	bigint hld2 = (bigint)k;
	return hld1 * hld2 * hld2 > LLONG_MAX;
}

int32_t main() {
	setIO();

	cin >> n >> k;
	a.rs(n);
	trav(i, a) {
		cin >> i;
	}
	trav(i, a) {
		cnt[i]++;
	}
	for(int i = 0; i < n; ++i) {
		if(!hld[a[i]] && ((a[i] % k == 0 ? !hld[a[i] / k] : 1))) {
			if(check(a[i]) || hld[a[i] * k]) {
				ans += cnt[a[i]];
			} else if(check1(a[i]) || (!hld[a[i] * k] && hld[a[i] * k * k])) { // means that a[i] * k * k will overflow
				if(cnt[a[i]] >= cnt[a[i] * k]) {
					ans += cnt[a[i]];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				} else {
					ans += cnt[a[i] * k];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				}
			} else {
				if(cnt[a[i]] + cnt[a[i] * k * k] >= cnt[a[i] * k]) {
					ans += cnt[a[i]] + cnt[a[i] * k * k];
				} else {
					ans += cnt[a[i] * k];
				}
				hld[a[i]] = hld[a[i] * k] = hld[a[i] * k * k] = 1;
			}
		}
	}
	cout << ans << nl;
}


#include "bits/stdc++.h" // template by Benq
using namespace std; // Debug template credit: Benq, ramchandra

using ll = long long;
using ld = long double;
using db = double;
using str = string;
using ull = unsigned ll;

using pi = pair<ll, ll>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;

using vi = vector<ll>;
using vd = vector<db>;
using vl = vector<ll>;
using vld = vector<ld>;
using vs = vector<str>;
using vb = vector<bool>;
using vc = vector<char>;
using vpi = vector<pl>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vl>;
using vvl = vector<vl>;
using vvc = vector<vc>;

#define pb push_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define f first
#define s second
#define si(a) ((int)(a).size())
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define rs resize
#define ins insert
#define nl "\n"
#define sor(a) sort(all(a))
#define res(a, n) a.rs(n); re(a)
#define int long long
#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; } )

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define rop(i, a) rep(i, 0, a)
#define per(i, a, b) for(auto i = (b) - 1; i >= (a); --i)
#define por(i, a) per(i, 0, a)
#define trav(i, a) for (auto& i: a)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> void uni(vector<T>& v) { sor(v); v.erase(unique(all(v)), end(v)); }
int cdiv(const ll& a, const ll& b) { return a / b + ((a ^ b) > 0 && a % b); } // (a / b) rounded up
int fdiv(const ll& a, const ll& b) { return a / b - ((a ^ b) < 0 && a % b); } // (a / b) rounded down
int fstTrue(function<bool(int)> f, int lo, int hi) { for(hi++; lo < hi;) { int mid = fdiv((lo + hi), 2); f(mid) ? hi = mid : lo = mid + 1; } return lo; }
int lstTrue(function<bool(int)> f, int lo, int hi) { for(lo--; lo < hi;) { int mid = fdiv((lo + hi + 1), 2); f(mid) ? lo = mid : hi = mid - 1; } return lo; }
int power(ll a, ll b, ll c) { ll res = 1; a %= c; while(b > 0) { if(b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
int power(ll a, ll b) { ll res = 1; while(b > 0) { if(b & 1) res = res * a; a = a * a; b >>= 1; } return res; }
ull modmul(ull a, ull b, const ull mod) { ll ret = a * b - mod * (ull)((ld)a * b / mod); return ret + ((ret < 0) - (ret >= (ll)mod)) * mod; }
ull modpow(ull a, ull b, const ull mod) { if(b == 0) { return 1; } ull res = modpow(a, b / 2, mod); res = modmul(res, res, mod); return b & 1 ? modmul(res, a, mod) : res; }
bool prime(ull n) { if(n < 2 || n % 6 % 4 != 1) { return n - 2 < 2; } ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, s = __builtin_ctzll(n - 1), d = n >> s; trav(i, A) { ull p = modpow(i, d, n), a = s; while(p != 1 && p != n - 1 && i % n && a--) { p = modmul(p, p, n); } if(p != n - 1 && a != s) { return false; } } return true; }
int pct(int x) { x = (x & 0x5555555555555555LL) + ((x >> 1) & 0x5555555555555555LL); x = (x & 0x3333333333333333LL) + ((x >> 2) & 0x3333333333333333LL); x = (x & 0x0F0F0F0F0F0F0F0FLL) + ((x >> 4) & 0x0F0F0F0F0F0F0F0FLL); return (x * 0x0101010101010101LL) >> 56; }
// uni: O(nlog(n)), cdiv: O(1), fdiv: O(1), fstTrue: O(log(hi - lo)), lstTrue: O(log(hi - lo)), gcd: O(log(min(a, b))), lcm: O(log(min(a, b))), power: O(log(b)), prime: O(sqrt(a)), pct: O(1)

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { string res = "{"; for(int i = 0; i < si(v); i++) { res += char('0' + v[i]); } res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) { string res = ""; for(int i = 0; i < (ll)SZ; i++) { res += char('0' + b[i]); } return res; }
template<class A, class B> string ts(pair<A, B> p) { return "(" + ts(p.f) + ", " + ts(p.s) + ")"; }
template<class T> string ts(T v) { bool fst = 1; string res = "{"; for(const auto& x: v) { if(!fst) { res += ", "; } fst = 0; res += ts(x); } res += "}"; return res; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << ts(h); if(sizeof...(t)) { cerr << ", "; } DBG(t...); }
void EDBG(string names) { names = names; }
template<class H, class... T> void EDBG(string names, H h, T... t) { auto pos = names.find(','); auto first_name = names.substr(0, pos); auto rest = names.substr(pos + 1); while(rest.front() == ' ') { rest = rest.substr(1); } cerr << "[" << first_name << "]: [" << ts(h) << "]" << nl; EDBG(rest, t...); }

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define edbg(...) EDBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 42
#define edbg(...) 7
#endif

// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(20); }
void setIO(string s = "") { unsyncIO(); if(si(s)) { setIn(s + ".in"); setOut(s + ".out"); } }

const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7; // 998244353
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;

const int base = 1e9,
	  base_digits = 9;
struct bigint {
	vi z;
	int sign;
	bigint(): sign(1) {}
	bigint(ll v) {
		* this = v;
	}
	bigint & operator = (ll v) {
		sign = v < 0 ? -1 : 1;
		v *= sign;
		z.clear();
		for(; v; v /= base) z.pb(v % base);
		return *this;
	}
	bigint(const str & s) {
		read(s);
	}

	bigint & operator += (const bigint & other) {

		if(sign == other.sign) {
			for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
				if(i == si(z)) z.pb(0);
				z[i] += carry + (i < si(other.z) ? other.z[i] : 0);
				carry = z[i] >= base;
				if(carry) z[i] -= base;
			}
		} else if(other != 0 ) * this -= -other;
		return *this;
	}
	friend bigint operator + (bigint a,
			const bigint & b) {
		return a += b;
	}
	bigint & operator -= (const bigint & other) {
		if(sign == other.sign) {
			if((sign == 1 && * this >= other) || (sign == -1 && * this <= other)) {
				for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
					z[i] -= carry + (i < si(other.z) ? other.z[i] : 0);
					carry = z[i] < 0;
					if(carry) z[i] += base;
				}
				trim();
			} else {
				* this = other - * this;
				this -> sign = -this -> sign;
			}
		} else *this += -other;
		return *this;
	}
	friend bigint operator - (bigint a,
			const bigint & b) {
		return a -= b;
	}

	bigint & operator *= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = 0, carry = 0; i < si(z) || carry; ++i) {
			if(i == si(z)) z.pb(0);
			ll cur = (ll) z[i] * v + carry;
			carry = cur / base;
			z[i] = cur % base;
		}
		trim();
		return *this;
	}
	bigint operator * (int v) const {
		return bigint( * this) *= v;
	}
	friend pair<bigint, bigint> divmod(const bigint & a1,
			const bigint & b1) {
		int norm = base / (b1.z.back() + 1);
		bigint a = a1.abs() * norm, b = b1.abs() * norm, q, r;
		q.z.rs(si(a.z));
		for(int i = si(a.z) - 1; i >= 0; --i) {
			r *= base;
			r += a.z[i];
			int s1 = si(b.z) < si(r.z) ? r.z[si(b.z)] : 0;
			int s2 = si(b.z) - 1 < si(r.z) ? r.z[si(b.z) - 1] : 0;
			int d = ((ll) s1 * base + s2) / b.z.back();
			r -= b * d;
			while (r < 0) r += b, --d;
			q.z[i] = d;
		}
		q.trim();
		r.trim();
		return {
			q,
				r / norm
		};
	}
	friend bigint sqrt(const bigint & a1) {
		bigint a = a1;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		int n = si(a.z), firstDigit = ::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int norm = base / (firstDigit + 1);
		a *= norm;
		a *= norm;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		bigint r = (ll) a.z[n - 1] * base + a.z[n - 2];
		firstDigit = (int)::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int q = firstDigit;
		bigint res;
		for(int j = n / 2 - 1; j >= 0; --j) {
			for(;; --q) {
				bigint r1 = (r - (res * 2 * base + q) * q) * base * base +
					(j > 0 ? (ll) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
				if(r1 >= 0) {
					r = r1;
					break;
				}
			}
			res *= base;
			res += q;
			if(j > 0) {
				int d1 = si(res.z) + 2 < si(r.z) ? r.z[si(res.z) + 2] : 0;
				int d2 = si(res.z) + 1 < si(r.z) ? r.z[si(res.z) + 1] : 0;
				int d3 = si(res.z) < si(r.z) ? r.z[si(res.z)] : 0;
				q = ((ll) d1 * base * base + (ll) d2 * base + d3) / (firstDigit * 2);
			}
		}
		res.trim();
		return res / norm;
	}
	bigint operator / (const bigint & v) const {
		return divmod( * this, v).f;
	}
	bigint operator % (const bigint & v) const {
		return divmod( * this, v).s;
	}
	bigint & operator /= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = si(z) - 1, rem = 0; i >= 0; --i) {
			ll cur = z[i] + rem * (ll) base;
			z[i] = cur / v;
			rem = cur % v;
		}
		trim();
		return *this;
	}
	bigint operator / (int v) const {
		return bigint( * this) /= v;
	}
	int operator % (int v) const {
		if(v < 0) v = -v;
		int m = 0;
		for(int i = si(z) - 1; i >= 0; --i) m = (z[i] + m * (ll) base) % v;
		return m * sign;
	}
	bigint & operator *= (const bigint & v) {
		return *this = * this * v;
	}
	bigint & operator /= (const bigint & v) {
		return *this = * this / v;
	}

	bool operator < (const bigint & v) const {
		if(sign != v.sign) return sign < v.sign;
		if(si(z) != si(v.z)) return si(z) * sign < si(v.z) * v.sign;
		for(int i = si(z) - 1; i >= 0; --i) if(z[i] != v.z[i]) return z[i] * sign < v.z[i] * sign;
		return 0;
	}
	bool operator > (const bigint & v) const {
		return v < * this;
	}
	bool operator <= (const bigint & v) const {
		return !(v < * this);
	}
	bool operator >= (const bigint & v) const {
		return !( * this < v);
	}
	bool operator == (const bigint & v) const {
		return !( * this < v) && !(v < * this);
	}
	bool operator != (const bigint & v) const {
		return *this < v || v < * this;
	}
	void trim() {
		while (si(z) && z.back() == 0) z.pop_back();
		if(!si(z)) sign = 1;
	}
	bool isZero() const {
		return !si(z);
	}
	friend bigint operator - (bigint v) {
		if(si(v.z)) v.sign = -v.sign;
		return v;
	}
	bigint abs() const {
		return sign == 1 ? * this : - * this;
	}
	ll longValue() const {
		ll res = 0;
		for(int i = si(z) - 1; i >= 0; --i) res = res * base + z[i];
		return res * sign;
	}
	friend bigint gcd(const bigint & a,
			const bigint & b) {
		return b.isZero() ? a : gcd(b, a % b);
	}
	friend bigint lcm(const bigint & a,
			const bigint & b) {
		return a / gcd(a, b) * b;
	}

	void read(const str & s) {
		sign = 1;
		z.clear();
		int pos = 0;
		while (pos < si(s) && (s[pos] == '-' || s[pos] == '+')) {
			if(s[pos] == '-') sign = -sign;
			++pos;
		}
		for(int i = si(s) - 1; i >= pos; i -= base_digits) {
			int x = 0;
			for(int j = max(pos, i - base_digits + 1); j <= i; j++)
				x = x * 10 + s[j] - '0';
			z.pb(x);
		}
		trim();
	}
	friend istream & operator >> (istream & is, bigint & v) {
		str s;
		is >> s;
		v.read(s);
		return is;
	}
	friend ostream & operator << (ostream & os, const bigint & v) {
		if(v.sign == -1) os << '-';
		os << (!si(v.z) ? 0 : v.z.back());
		for(int i = si(v.z) - 1 - 1; i >= 0; --i) os << setw(base_digits) << setfill('0') << v.z[i];
		return os;
	}
	static vi convert_base(const vi & a, int old_digits, int new_digits) {
		vl p(max(old_digits, new_digits) + 1);
		p[0] = 1;
		for(int i = 1; i < si(p); ++i) p[i] = p[i - 1] * 10;
		vi ans;
		ll cur = 0;
		int cur_digits = 0;
		for(int v: a) {
			cur += v * p[cur_digits];
			cur_digits += old_digits;
			while (cur_digits >= new_digits) {
				ans.pb(cur % p[new_digits]);
				cur /= p[new_digits];
				cur_digits -= new_digits;
			}
		}
		ans.pb(cur);
		while (si(ans) && ans.back() == 0) ans.pop_back();
		return ans;
	}
	static vl karatMul(const vl & a, const vl & b) {
		int n = si(a);
		vl ans(2 * n);
		if(n <= 32) {
			for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j) ans[i + j] += a[i] * b[j];
			return ans;
		}
		int k = n / 2;
		vl a1(begin(a), begin(a) + k), a2(k + all(a));
		vl b1(begin(b), begin(b) + k), b2(k + all(b));
		vl a1b1 = karatMul(a1, b1), a2b2 = karatMul(a2, b2);
		for(int i = 0; i < k; ++i) a2[i] += a1[i], b2[i] += b1[i];
		vl r = karatMul(a2, b2);
		for(int i = 0; i < si(a1b1); ++i) r[i] -= a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) r[i] -= a2b2[i];
		for(int i = 0; i < si(r); ++i) ans[i + k] += r[i];
		for(int i = 0; i < si(a1b1); ++i) ans[i] += a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) ans[i + n] += a2b2[i];
		return ans;
	}
	bigint operator * (const bigint & v) const {
		if(min(si(z), si(v.z)) < 150) return mul_simple(v);
		bigint ans;
		vi a6 = convert_base(this -> z, base_digits, 6);
		vi b6 = convert_base(v.z, base_digits, 6);
		vl a(all(a6)), b(all(b6));
		while (si(a) < si(b)) a.pb(0);
		while (si(b) < si(a)) b.pb(0);
		while (si(a) & (si(a) - 1)) a.pb(0), b.pb(0);
		vl c = karatMul(a, b);
		ll cur = 0;
		for(int i = 0; i < si(c); ++i) {
			cur += c[i];
			ans.z.pb(cur % 1000000);
			cur /= 1000000;
		}
		ans.z = convert_base(ans.z, 6, base_digits);
		ans.trim();
		return ans;
	}
	bigint mul_simple(const bigint & v) const {
		bigint ans;
		ans.z.rs(si(z) + si(v.z));
		for(int i = 0; i < si(z); ++i)
			if(z[i]) {
				ll cur = 0;
				for(int j = 0; j < si(v.z) || cur; ++j) {
					cur += ans.z[i + j] + (ll) z[i] * (j < si(v.z) ? v.z[j] : 0);
					ans.z[i + j] = cur % base;
					cur /= base;
				}
			}
		ans.trim();
		return ans;
	}
	friend str ts(const bigint & v) {
		stringstream ss;
		ss << v;
		str s;
		ss >> s;
		return s;
	}
};

struct custom_hash { // Credits: https://codeforces.com/blog/entry/62393
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(a + FIXED_RANDOM);
	}
	template<class T> size_t operator()(T a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		return splitmix64(x(a) + FIXED_RANDOM);
	}
	template<class T, class H> size_t operator()(pair<T, H> a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		hash<H> y;
		return splitmix64(x(a.f) * 37 + y(a.s) + FIXED_RANDOM);
	}
};
template<class T, class H> using umap = unordered_map<T, H, custom_hash>;
template<class T> using uset = unordered_set<T, custom_hash>;

int n, k, ans;
vi a;
umap<int, int> cnt;
bitset<MOD + 3> hld;

bool check(int x) {
	bigint hld1 = (bigint)x;
	bigint hld2 = (bigint)k;
	return hld1 * hld2 > LLONG_MAX;
}

bool check1(int x) {
	bigint hld1 = (bigint)x;
	bigint hld2 = (bigint)k;
	return hld1 * hld2 * hld2 > LLONG_MAX;
}

int32_t main() {
	setIO();

	cin >> n >> k;
	a.rs(n);
	trav(i, a) {
		cin >> i;
	}
	trav(i, a) {
		cnt[i]++;
	}
	for(int i = 0; i < n; ++i) {
		if(!hld[a[i]] && ((a[i] % k == 0 ? !hld[a[i] / k] : 1))) {
			if(check(a[i]) || hld[a[i] * k]) {
				ans += cnt[a[i]];
			} else if(check1(a[i]) || (!hld[a[i] * k] && hld[a[i] * k * k])) { // means that a[i] * k * k will overflow
				if(cnt[a[i]] >= cnt[a[i] * k]) {
					ans += cnt[a[i]];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				} else {
					ans += cnt[a[i] * k];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				}
			} else {
				if(cnt[a[i]] + cnt[a[i] * k * k] >= cnt[a[i] * k]) {
					ans += cnt[a[i]] + cnt[a[i] * k * k];
				} else {
					ans += cnt[a[i] * k];
				}
				hld[a[i]] = hld[a[i] * k] = hld[a[i] * k * k] = 1;
			}
		}
	}
	cout << ans << nl;
}


#include "bits/stdc++.h" // template by Benq
using namespace std; // Debug template credit: Benq, ramchandra

using ll = long long;
using ld = long double;
using db = double;
using str = string;
using ull = unsigned ll;

using pi = pair<ll, ll>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;

using vi = vector<ll>;
using vd = vector<db>;
using vl = vector<ll>;
using vld = vector<ld>;
using vs = vector<str>;
using vb = vector<bool>;
using vc = vector<char>;
using vpi = vector<pl>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vl>;
using vvl = vector<vl>;
using vvc = vector<vc>;

#define pb push_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define f first
#define s second
#define si(a) ((int)(a).size())
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define rs resize
#define ins insert
#define nl "\n"
#define sor(a) sort(all(a))
#define res(a, n) a.rs(n); re(a)
#define int long long
#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; } )

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define rop(i, a) rep(i, 0, a)
#define per(i, a, b) for(auto i = (b) - 1; i >= (a); --i)
#define por(i, a) per(i, 0, a)
#define trav(i, a) for (auto& i: a)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> void uni(vector<T>& v) { sor(v); v.erase(unique(all(v)), end(v)); }
int cdiv(const ll& a, const ll& b) { return a / b + ((a ^ b) > 0 && a % b); } // (a / b) rounded up
int fdiv(const ll& a, const ll& b) { return a / b - ((a ^ b) < 0 && a % b); } // (a / b) rounded down
int fstTrue(function<bool(int)> f, int lo, int hi) { for(hi++; lo < hi;) { int mid = fdiv((lo + hi), 2); f(mid) ? hi = mid : lo = mid + 1; } return lo; }
int lstTrue(function<bool(int)> f, int lo, int hi) { for(lo--; lo < hi;) { int mid = fdiv((lo + hi + 1), 2); f(mid) ? lo = mid : hi = mid - 1; } return lo; }
int power(ll a, ll b, ll c) { ll res = 1; a %= c; while(b > 0) { if(b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
int power(ll a, ll b) { ll res = 1; while(b > 0) { if(b & 1) res = res * a; a = a * a; b >>= 1; } return res; }
ull modmul(ull a, ull b, const ull mod) { ll ret = a * b - mod * (ull)((ld)a * b / mod); return ret + ((ret < 0) - (ret >= (ll)mod)) * mod; }
ull modpow(ull a, ull b, const ull mod) { if(b == 0) { return 1; } ull res = modpow(a, b / 2, mod); res = modmul(res, res, mod); return b & 1 ? modmul(res, a, mod) : res; }
bool prime(ull n) { if(n < 2 || n % 6 % 4 != 1) { return n - 2 < 2; } ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, s = __builtin_ctzll(n - 1), d = n >> s; trav(i, A) { ull p = modpow(i, d, n), a = s; while(p != 1 && p != n - 1 && i % n && a--) { p = modmul(p, p, n); } if(p != n - 1 && a != s) { return false; } } return true; }
int pct(int x) { x = (x & 0x5555555555555555LL) + ((x >> 1) & 0x5555555555555555LL); x = (x & 0x3333333333333333LL) + ((x >> 2) & 0x3333333333333333LL); x = (x & 0x0F0F0F0F0F0F0F0FLL) + ((x >> 4) & 0x0F0F0F0F0F0F0F0FLL); return (x * 0x0101010101010101LL) >> 56; }
// uni: O(nlog(n)), cdiv: O(1), fdiv: O(1), fstTrue: O(log(hi - lo)), lstTrue: O(log(hi - lo)), gcd: O(log(min(a, b))), lcm: O(log(min(a, b))), power: O(log(b)), prime: O(sqrt(a)), pct: O(1)

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { string res = "{"; for(int i = 0; i < si(v); i++) { res += char('0' + v[i]); } res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) { string res = ""; for(int i = 0; i < (ll)SZ; i++) { res += char('0' + b[i]); } return res; }
template<class A, class B> string ts(pair<A, B> p) { return "(" + ts(p.f) + ", " + ts(p.s) + ")"; }
template<class T> string ts(T v) { bool fst = 1; string res = "{"; for(const auto& x: v) { if(!fst) { res += ", "; } fst = 0; res += ts(x); } res += "}"; return res; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << ts(h); if(sizeof...(t)) { cerr << ", "; } DBG(t...); }
void EDBG(string names) { names = names; }
template<class H, class... T> void EDBG(string names, H h, T... t) { auto pos = names.find(','); auto first_name = names.substr(0, pos); auto rest = names.substr(pos + 1); while(rest.front() == ' ') { rest = rest.substr(1); } cerr << "[" << first_name << "]: [" << ts(h) << "]" << nl; EDBG(rest, t...); }

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define edbg(...) EDBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 42
#define edbg(...) 7
#endif

// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(20); }
void setIO(string s = "") { unsyncIO(); if(si(s)) { setIn(s + ".in"); setOut(s + ".out"); } }

const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7; // 998244353
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;

const int base = 1e9,
	  base_digits = 9;
struct bigint {
	vi z;
	int sign;
	bigint(): sign(1) {}
	bigint(ll v) {
		* this = v;
	}
	bigint & operator = (ll v) {
		sign = v < 0 ? -1 : 1;
		v *= sign;
		z.clear();
		for(; v; v /= base) z.pb(v % base);
		return *this;
	}
	bigint(const str & s) {
		read(s);
	}

	bigint & operator += (const bigint & other) {

		if(sign == other.sign) {
			for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
				if(i == si(z)) z.pb(0);
				z[i] += carry + (i < si(other.z) ? other.z[i] : 0);
				carry = z[i] >= base;
				if(carry) z[i] -= base;
			}
		} else if(other != 0 ) * this -= -other;
		return *this;
	}
	friend bigint operator + (bigint a,
			const bigint & b) {
		return a += b;
	}
	bigint & operator -= (const bigint & other) {
		if(sign == other.sign) {
			if((sign == 1 && * this >= other) || (sign == -1 && * this <= other)) {
				for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
					z[i] -= carry + (i < si(other.z) ? other.z[i] : 0);
					carry = z[i] < 0;
					if(carry) z[i] += base;
				}
				trim();
			} else {
				* this = other - * this;
				this -> sign = -this -> sign;
			}
		} else *this += -other;
		return *this;
	}
	friend bigint operator - (bigint a,
			const bigint & b) {
		return a -= b;
	}

	bigint & operator *= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = 0, carry = 0; i < si(z) || carry; ++i) {
			if(i == si(z)) z.pb(0);
			ll cur = (ll) z[i] * v + carry;
			carry = cur / base;
			z[i] = cur % base;
		}
		trim();
		return *this;
	}
	bigint operator * (int v) const {
		return bigint( * this) *= v;
	}
	friend pair<bigint, bigint> divmod(const bigint & a1,
			const bigint & b1) {
		int norm = base / (b1.z.back() + 1);
		bigint a = a1.abs() * norm, b = b1.abs() * norm, q, r;
		q.z.rs(si(a.z));
		for(int i = si(a.z) - 1; i >= 0; --i) {
			r *= base;
			r += a.z[i];
			int s1 = si(b.z) < si(r.z) ? r.z[si(b.z)] : 0;
			int s2 = si(b.z) - 1 < si(r.z) ? r.z[si(b.z) - 1] : 0;
			int d = ((ll) s1 * base + s2) / b.z.back();
			r -= b * d;
			while (r < 0) r += b, --d;
			q.z[i] = d;
		}
		q.trim();
		r.trim();
		return {
			q,
				r / norm
		};
	}
	friend bigint sqrt(const bigint & a1) {
		bigint a = a1;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		int n = si(a.z), firstDigit = ::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int norm = base / (firstDigit + 1);
		a *= norm;
		a *= norm;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		bigint r = (ll) a.z[n - 1] * base + a.z[n - 2];
		firstDigit = (int)::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int q = firstDigit;
		bigint res;
		for(int j = n / 2 - 1; j >= 0; --j) {
			for(;; --q) {
				bigint r1 = (r - (res * 2 * base + q) * q) * base * base +
					(j > 0 ? (ll) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
				if(r1 >= 0) {
					r = r1;
					break;
				}
			}
			res *= base;
			res += q;
			if(j > 0) {
				int d1 = si(res.z) + 2 < si(r.z) ? r.z[si(res.z) + 2] : 0;
				int d2 = si(res.z) + 1 < si(r.z) ? r.z[si(res.z) + 1] : 0;
				int d3 = si(res.z) < si(r.z) ? r.z[si(res.z)] : 0;
				q = ((ll) d1 * base * base + (ll) d2 * base + d3) / (firstDigit * 2);
			}
		}
		res.trim();
		return res / norm;
	}
	bigint operator / (const bigint & v) const {
		return divmod( * this, v).f;
	}
	bigint operator % (const bigint & v) const {
		return divmod( * this, v).s;
	}
	bigint & operator /= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = si(z) - 1, rem = 0; i >= 0; --i) {
			ll cur = z[i] + rem * (ll) base;
			z[i] = cur / v;
			rem = cur % v;
		}
		trim();
		return *this;
	}
	bigint operator / (int v) const {
		return bigint( * this) /= v;
	}
	int operator % (int v) const {
		if(v < 0) v = -v;
		int m = 0;
		for(int i = si(z) - 1; i >= 0; --i) m = (z[i] + m * (ll) base) % v;
		return m * sign;
	}
	bigint & operator *= (const bigint & v) {
		return *this = * this * v;
	}
	bigint & operator /= (const bigint & v) {
		return *this = * this / v;
	}

	bool operator < (const bigint & v) const {
		if(sign != v.sign) return sign < v.sign;
		if(si(z) != si(v.z)) return si(z) * sign < si(v.z) * v.sign;
		for(int i = si(z) - 1; i >= 0; --i) if(z[i] != v.z[i]) return z[i] * sign < v.z[i] * sign;
		return 0;
	}
	bool operator > (const bigint & v) const {
		return v < * this;
	}
	bool operator <= (const bigint & v) const {
		return !(v < * this);
	}
	bool operator >= (const bigint & v) const {
		return !( * this < v);
	}
	bool operator == (const bigint & v) const {
		return !( * this < v) && !(v < * this);
	}
	bool operator != (const bigint & v) const {
		return *this < v || v < * this;
	}
	void trim() {
		while (si(z) && z.back() == 0) z.pop_back();
		if(!si(z)) sign = 1;
	}
	bool isZero() const {
		return !si(z);
	}
	friend bigint operator - (bigint v) {
		if(si(v.z)) v.sign = -v.sign;
		return v;
	}
	bigint abs() const {
		return sign == 1 ? * this : - * this;
	}
	ll longValue() const {
		ll res = 0;
		for(int i = si(z) - 1; i >= 0; --i) res = res * base + z[i];
		return res * sign;
	}
	friend bigint gcd(const bigint & a,
			const bigint & b) {
		return b.isZero() ? a : gcd(b, a % b);
	}
	friend bigint lcm(const bigint & a,
			const bigint & b) {
		return a / gcd(a, b) * b;
	}

	void read(const str & s) {
		sign = 1;
		z.clear();
		int pos = 0;
		while (pos < si(s) && (s[pos] == '-' || s[pos] == '+')) {
			if(s[pos] == '-') sign = -sign;
			++pos;
		}
		for(int i = si(s) - 1; i >= pos; i -= base_digits) {
			int x = 0;
			for(int j = max(pos, i - base_digits + 1); j <= i; j++)
				x = x * 10 + s[j] - '0';
			z.pb(x);
		}
		trim();
	}
	friend istream & operator >> (istream & is, bigint & v) {
		str s;
		is >> s;
		v.read(s);
		return is;
	}
	friend ostream & operator << (ostream & os, const bigint & v) {
		if(v.sign == -1) os << '-';
		os << (!si(v.z) ? 0 : v.z.back());
		for(int i = si(v.z) - 1 - 1; i >= 0; --i) os << setw(base_digits) << setfill('0') << v.z[i];
		return os;
	}
	static vi convert_base(const vi & a, int old_digits, int new_digits) {
		vl p(max(old_digits, new_digits) + 1);
		p[0] = 1;
		for(int i = 1; i < si(p); ++i) p[i] = p[i - 1] * 10;
		vi ans;
		ll cur = 0;
		int cur_digits = 0;
		for(int v: a) {
			cur += v * p[cur_digits];
			cur_digits += old_digits;
			while (cur_digits >= new_digits) {
				ans.pb(cur % p[new_digits]);
				cur /= p[new_digits];
				cur_digits -= new_digits;
			}
		}
		ans.pb(cur);
		while (si(ans) && ans.back() == 0) ans.pop_back();
		return ans;
	}
	static vl karatMul(const vl & a, const vl & b) {
		int n = si(a);
		vl ans(2 * n);
		if(n <= 32) {
			for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j) ans[i + j] += a[i] * b[j];
			return ans;
		}
		int k = n / 2;
		vl a1(begin(a), begin(a) + k), a2(k + all(a));
		vl b1(begin(b), begin(b) + k), b2(k + all(b));
		vl a1b1 = karatMul(a1, b1), a2b2 = karatMul(a2, b2);
		for(int i = 0; i < k; ++i) a2[i] += a1[i], b2[i] += b1[i];
		vl r = karatMul(a2, b2);
		for(int i = 0; i < si(a1b1); ++i) r[i] -= a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) r[i] -= a2b2[i];
		for(int i = 0; i < si(r); ++i) ans[i + k] += r[i];
		for(int i = 0; i < si(a1b1); ++i) ans[i] += a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) ans[i + n] += a2b2[i];
		return ans;
	}
	bigint operator * (const bigint & v) const {
		if(min(si(z), si(v.z)) < 150) return mul_simple(v);
		bigint ans;
		vi a6 = convert_base(this -> z, base_digits, 6);
		vi b6 = convert_base(v.z, base_digits, 6);
		vl a(all(a6)), b(all(b6));
		while (si(a) < si(b)) a.pb(0);
		while (si(b) < si(a)) b.pb(0);
		while (si(a) & (si(a) - 1)) a.pb(0), b.pb(0);
		vl c = karatMul(a, b);
		ll cur = 0;
		for(int i = 0; i < si(c); ++i) {
			cur += c[i];
			ans.z.pb(cur % 1000000);
			cur /= 1000000;
		}
		ans.z = convert_base(ans.z, 6, base_digits);
		ans.trim();
		return ans;
	}
	bigint mul_simple(const bigint & v) const {
		bigint ans;
		ans.z.rs(si(z) + si(v.z));
		for(int i = 0; i < si(z); ++i)
			if(z[i]) {
				ll cur = 0;
				for(int j = 0; j < si(v.z) || cur; ++j) {
					cur += ans.z[i + j] + (ll) z[i] * (j < si(v.z) ? v.z[j] : 0);
					ans.z[i + j] = cur % base;
					cur /= base;
				}
			}
		ans.trim();
		return ans;
	}
	friend str ts(const bigint & v) {
		stringstream ss;
		ss << v;
		str s;
		ss >> s;
		return s;
	}
};

struct custom_hash { // Credits: https://codeforces.com/blog/entry/62393
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(a + FIXED_RANDOM);
	}
	template<class T> size_t operator()(T a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		return splitmix64(x(a) + FIXED_RANDOM);
	}
	template<class T, class H> size_t operator()(pair<T, H> a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		hash<H> y;
		return splitmix64(x(a.f) * 37 + y(a.s) + FIXED_RANDOM);
	}
};
template<class T, class H> using umap = unordered_map<T, H, custom_hash>;
template<class T> using uset = unordered_set<T, custom_hash>;

int n, k, ans;
vi a;
umap<int, int> cnt;
bitset<MOD + 3> hld;

bool check(int x) {
	bigint y = x * k;
	return y > LLONG_MAX;
}

bool check1(int x) {
	bigint y = x * k * k;
	return y > LLONG_MAX;
}

int32_t main() {
	setIO();

	cin >> n >> k;
	a.rs(n);
	trav(i, a) {
		cin >> i;
	}
	trav(i, a) {
		cnt[i]++;
	}
	for(int i = 0; i < n; ++i) {
		if(!hld[a[i]]) {
			if(check(a[i]) || hld[a[i] * k]) {
				ans += cnt[a[i]];
			} else if(check1(a[i]) || (!hld[a[i] * k] && hld[a[i] * k * k])) { // means that a[i] * k * k will overflow
				if(cnt[a[i]] >= cnt[a[i] * k]) {
					ans += cnt[a[i]];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				} else {
					ans += cnt[a[i] * k];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				}
			} else {
				if(cnt[a[i]] + cnt[a[i] * k * k] >= cnt[a[i] * k]) {
					ans += cnt[a[i]] + cnt[a[i] * k * k];
				} else {
					ans += cnt[a[i] * k];
				}
				hld[a[i]] = hld[a[i] * k] = hld[a[i] * k * k] = 1;
			}
		}
	}
	cout << ans << nl;
}


#include<bits/stdc++.h>
#define F for(i=0;i<n;i++)
using namespace std;int n,k,a[1<<19],i,r,u;map<int,int>s;main(){cin>>n>>k;F cin>>a[i];sort(a,a+n);F if((u=a[i])%k|!s[u/k])s[u]=++r;cout<<r;}


#include "bits/stdc++.h" // template by Benq
using namespace std; // Debug template credit: Benq, ramchandra

using ll = long long;
using ld = long double;
using db = double;
using str = string;
using ull = unsigned ll;

using pi = pair<ll, ll>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;

using vi = vector<ll>;
using vd = vector<db>;
using vl = vector<ll>;
using vld = vector<ld>;
using vs = vector<str>;
using vb = vector<bool>;
using vc = vector<char>;
using vpi = vector<pl>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vl>;
using vvl = vector<vl>;
using vvc = vector<vc>;

#define pb push_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define f first
#define s second
#define si(a) ((int)(a).size())
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define rs resize
#define ins insert
#define nl "\n"
#define sor(a) sort(all(a))
#define res(a, n) a.rs(n); re(a)
#define int long long
#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; } )

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define rop(i, a) rep(i, 0, a)
#define per(i, a, b) for(auto i = (b) - 1; i >= (a); --i)
#define por(i, a) per(i, 0, a)
#define trav(i, a) for (auto& i: a)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> void uni(vector<T>& v) { sor(v); v.erase(unique(all(v)), end(v)); }
int cdiv(const ll& a, const ll& b) { return a / b + ((a ^ b) > 0 && a % b); } // (a / b) rounded up
int fdiv(const ll& a, const ll& b) { return a / b - ((a ^ b) < 0 && a % b); } // (a / b) rounded down
int fstTrue(function<bool(int)> f, int lo, int hi) { for(hi++; lo < hi;) { int mid = fdiv((lo + hi), 2); f(mid) ? hi = mid : lo = mid + 1; } return lo; }
int lstTrue(function<bool(int)> f, int lo, int hi) { for(lo--; lo < hi;) { int mid = fdiv((lo + hi + 1), 2); f(mid) ? lo = mid : hi = mid - 1; } return lo; }
int power(ll a, ll b, ll c) { ll res = 1; a %= c; while(b > 0) { if(b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
int power(ll a, ll b) { ll res = 1; while(b > 0) { if(b & 1) res = res * a; a = a * a; b >>= 1; } return res; }
ull modmul(ull a, ull b, const ull mod) { ll ret = a * b - mod * (ull)((ld)a * b / mod); return ret + ((ret < 0) - (ret >= (ll)mod)) * mod; }
ull modpow(ull a, ull b, const ull mod) { if(b == 0) { return 1; } ull res = modpow(a, b / 2, mod); res = modmul(res, res, mod); return b & 1 ? modmul(res, a, mod) : res; }
bool prime(ull n) { if(n < 2 || n % 6 % 4 != 1) { return n - 2 < 2; } ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, s = __builtin_ctzll(n - 1), d = n >> s; trav(i, A) { ull p = modpow(i, d, n), a = s; while(p != 1 && p != n - 1 && i % n && a--) { p = modmul(p, p, n); } if(p != n - 1 && a != s) { return false; } } return true; }
int pct(int x) { x = (x & 0x5555555555555555LL) + ((x >> 1) & 0x5555555555555555LL); x = (x & 0x3333333333333333LL) + ((x >> 2) & 0x3333333333333333LL); x = (x & 0x0F0F0F0F0F0F0F0FLL) + ((x >> 4) & 0x0F0F0F0F0F0F0F0FLL); return (x * 0x0101010101010101LL) >> 56; }
// uni: O(nlog(n)), cdiv: O(1), fdiv: O(1), fstTrue: O(log(hi - lo)), lstTrue: O(log(hi - lo)), gcd: O(log(min(a, b))), lcm: O(log(min(a, b))), power: O(log(b)), prime: O(sqrt(a)), pct: O(1)

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { string res = "{"; for(int i = 0; i < si(v); i++) { res += char('0' + v[i]); } res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) { string res = ""; for(int i = 0; i < (ll)SZ; i++) { res += char('0' + b[i]); } return res; }
template<class A, class B> string ts(pair<A, B> p) { return "(" + ts(p.f) + ", " + ts(p.s) + ")"; }
template<class T> string ts(T v) { bool fst = 1; string res = "{"; for(const auto& x: v) { if(!fst) { res += ", "; } fst = 0; res += ts(x); } res += "}"; return res; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << ts(h); if(sizeof...(t)) { cerr << ", "; } DBG(t...); }
void EDBG(string names) { names = names; }
template<class H, class... T> void EDBG(string names, H h, T... t) { auto pos = names.find(','); auto first_name = names.substr(0, pos); auto rest = names.substr(pos + 1); while(rest.front() == ' ') { rest = rest.substr(1); } cerr << "[" << first_name << "]: [" << ts(h) << "]" << nl; EDBG(rest, t...); }

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define edbg(...) EDBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 42
#define edbg(...) 7
#endif

// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(20); }
void setIO(string s = "") { unsyncIO(); if(si(s)) { setIn(s + ".in"); setOut(s + ".out"); } }

const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7; // 998244353
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;

const int base = 1e9,
	  base_digits = 9;
struct bigint {
	vi z;
	int sign;
	bigint(): sign(1) {}
	bigint(ll v) {
		* this = v;
	}
	bigint & operator = (ll v) {
		sign = v < 0 ? -1 : 1;
		v *= sign;
		z.clear();
		for(; v; v /= base) z.pb(v % base);
		return *this;
	}
	bigint(const str & s) {
		read(s);
	}

	bigint & operator += (const bigint & other) {

		if(sign == other.sign) {
			for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
				if(i == si(z)) z.pb(0);
				z[i] += carry + (i < si(other.z) ? other.z[i] : 0);
				carry = z[i] >= base;
				if(carry) z[i] -= base;
			}
		} else if(other != 0 ) * this -= -other;
		return *this;
	}
	friend bigint operator + (bigint a,
			const bigint & b) {
		return a += b;
	}
	bigint & operator -= (const bigint & other) {
		if(sign == other.sign) {
			if((sign == 1 && * this >= other) || (sign == -1 && * this <= other)) {
				for(int i = 0, carry = 0; i < si(other.z) || carry; ++i) {
					z[i] -= carry + (i < si(other.z) ? other.z[i] : 0);
					carry = z[i] < 0;
					if(carry) z[i] += base;
				}
				trim();
			} else {
				* this = other - * this;
				this -> sign = -this -> sign;
			}
		} else *this += -other;
		return *this;
	}
	friend bigint operator - (bigint a,
			const bigint & b) {
		return a -= b;
	}

	bigint & operator *= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = 0, carry = 0; i < si(z) || carry; ++i) {
			if(i == si(z)) z.pb(0);
			ll cur = (ll) z[i] * v + carry;
			carry = cur / base;
			z[i] = cur % base;
		}
		trim();
		return *this;
	}
	bigint operator * (int v) const {
		return bigint( * this) *= v;
	}
	friend pair<bigint, bigint> divmod(const bigint & a1,
			const bigint & b1) {
		int norm = base / (b1.z.back() + 1);
		bigint a = a1.abs() * norm, b = b1.abs() * norm, q, r;
		q.z.rs(si(a.z));
		for(int i = si(a.z) - 1; i >= 0; --i) {
			r *= base;
			r += a.z[i];
			int s1 = si(b.z) < si(r.z) ? r.z[si(b.z)] : 0;
			int s2 = si(b.z) - 1 < si(r.z) ? r.z[si(b.z) - 1] : 0;
			int d = ((ll) s1 * base + s2) / b.z.back();
			r -= b * d;
			while (r < 0) r += b, --d;
			q.z[i] = d;
		}
		q.trim();
		r.trim();
		return {
			q,
				r / norm
		};
	}
	friend bigint sqrt(const bigint & a1) {
		bigint a = a1;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		int n = si(a.z), firstDigit = ::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int norm = base / (firstDigit + 1);
		a *= norm;
		a *= norm;
		while (!si(a.z) || si(a.z) & 1) a.z.pb(0);
		bigint r = (ll) a.z[n - 1] * base + a.z[n - 2];
		firstDigit = (int)::sqrt((db) a.z[n - 1] * base + a.z[n - 2]);
		int q = firstDigit;
		bigint res;
		for(int j = n / 2 - 1; j >= 0; --j) {
			for(;; --q) {
				bigint r1 = (r - (res * 2 * base + q) * q) * base * base +
					(j > 0 ? (ll) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
				if(r1 >= 0) {
					r = r1;
					break;
				}
			}
			res *= base;
			res += q;
			if(j > 0) {
				int d1 = si(res.z) + 2 < si(r.z) ? r.z[si(res.z) + 2] : 0;
				int d2 = si(res.z) + 1 < si(r.z) ? r.z[si(res.z) + 1] : 0;
				int d3 = si(res.z) < si(r.z) ? r.z[si(res.z)] : 0;
				q = ((ll) d1 * base * base + (ll) d2 * base + d3) / (firstDigit * 2);
			}
		}
		res.trim();
		return res / norm;
	}
	bigint operator / (const bigint & v) const {
		return divmod( * this, v).f;
	}
	bigint operator % (const bigint & v) const {
		return divmod( * this, v).s;
	}
	bigint & operator /= (int v) {
		if(v < 0) sign = -sign, v = -v;
		for(int i = si(z) - 1, rem = 0; i >= 0; --i) {
			ll cur = z[i] + rem * (ll) base;
			z[i] = cur / v;
			rem = cur % v;
		}
		trim();
		return *this;
	}
	bigint operator / (int v) const {
		return bigint( * this) /= v;
	}
	int operator % (int v) const {
		if(v < 0) v = -v;
		int m = 0;
		for(int i = si(z) - 1; i >= 0; --i) m = (z[i] + m * (ll) base) % v;
		return m * sign;
	}
	bigint & operator *= (const bigint & v) {
		return *this = * this * v;
	}
	bigint & operator /= (const bigint & v) {
		return *this = * this / v;
	}

	bool operator < (const bigint & v) const {
		if(sign != v.sign) return sign < v.sign;
		if(si(z) != si(v.z)) return si(z) * sign < si(v.z) * v.sign;
		for(int i = si(z) - 1; i >= 0; --i) if(z[i] != v.z[i]) return z[i] * sign < v.z[i] * sign;
		return 0;
	}
	bool operator > (const bigint & v) const {
		return v < * this;
	}
	bool operator <= (const bigint & v) const {
		return !(v < * this);
	}
	bool operator >= (const bigint & v) const {
		return !( * this < v);
	}
	bool operator == (const bigint & v) const {
		return !( * this < v) && !(v < * this);
	}
	bool operator != (const bigint & v) const {
		return *this < v || v < * this;
	}
	void trim() {
		while (si(z) && z.back() == 0) z.pop_back();
		if(!si(z)) sign = 1;
	}
	bool isZero() const {
		return !si(z);
	}
	friend bigint operator - (bigint v) {
		if(si(v.z)) v.sign = -v.sign;
		return v;
	}
	bigint abs() const {
		return sign == 1 ? * this : - * this;
	}
	ll longValue() const {
		ll res = 0;
		for(int i = si(z) - 1; i >= 0; --i) res = res * base + z[i];
		return res * sign;
	}
	friend bigint gcd(const bigint & a,
			const bigint & b) {
		return b.isZero() ? a : gcd(b, a % b);
	}
	friend bigint lcm(const bigint & a,
			const bigint & b) {
		return a / gcd(a, b) * b;
	}

	void read(const str & s) {
		sign = 1;
		z.clear();
		int pos = 0;
		while (pos < si(s) && (s[pos] == '-' || s[pos] == '+')) {
			if(s[pos] == '-') sign = -sign;
			++pos;
		}
		for(int i = si(s) - 1; i >= pos; i -= base_digits) {
			int x = 0;
			for(int j = max(pos, i - base_digits + 1); j <= i; j++)
				x = x * 10 + s[j] - '0';
			z.pb(x);
		}
		trim();
	}
	friend istream & operator >> (istream & is, bigint & v) {
		str s;
		is >> s;
		v.read(s);
		return is;
	}
	friend ostream & operator << (ostream & os, const bigint & v) {
		if(v.sign == -1) os << '-';
		os << (!si(v.z) ? 0 : v.z.back());
		for(int i = si(v.z) - 1 - 1; i >= 0; --i) os << setw(base_digits) << setfill('0') << v.z[i];
		return os;
	}
	static vi convert_base(const vi & a, int old_digits, int new_digits) {
		vl p(max(old_digits, new_digits) + 1);
		p[0] = 1;
		for(int i = 1; i < si(p); ++i) p[i] = p[i - 1] * 10;
		vi ans;
		ll cur = 0;
		int cur_digits = 0;
		for(int v: a) {
			cur += v * p[cur_digits];
			cur_digits += old_digits;
			while (cur_digits >= new_digits) {
				ans.pb(cur % p[new_digits]);
				cur /= p[new_digits];
				cur_digits -= new_digits;
			}
		}
		ans.pb(cur);
		while (si(ans) && ans.back() == 0) ans.pop_back();
		return ans;
	}
	static vl karatMul(const vl & a, const vl & b) {
		int n = si(a);
		vl ans(2 * n);
		if(n <= 32) {
			for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j) ans[i + j] += a[i] * b[j];
			return ans;
		}
		int k = n / 2;
		vl a1(begin(a), begin(a) + k), a2(k + all(a));
		vl b1(begin(b), begin(b) + k), b2(k + all(b));
		vl a1b1 = karatMul(a1, b1), a2b2 = karatMul(a2, b2);
		for(int i = 0; i < k; ++i) a2[i] += a1[i], b2[i] += b1[i];
		vl r = karatMul(a2, b2);
		for(int i = 0; i < si(a1b1); ++i) r[i] -= a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) r[i] -= a2b2[i];
		for(int i = 0; i < si(r); ++i) ans[i + k] += r[i];
		for(int i = 0; i < si(a1b1); ++i) ans[i] += a1b1[i];
		for(int i = 0; i < si(a2b2); ++i) ans[i + n] += a2b2[i];
		return ans;
	}
	bigint operator * (const bigint & v) const {
		if(min(si(z), si(v.z)) < 150) return mul_simple(v);
		bigint ans;
		vi a6 = convert_base(this -> z, base_digits, 6);
		vi b6 = convert_base(v.z, base_digits, 6);
		vl a(all(a6)), b(all(b6));
		while (si(a) < si(b)) a.pb(0);
		while (si(b) < si(a)) b.pb(0);
		while (si(a) & (si(a) - 1)) a.pb(0), b.pb(0);
		vl c = karatMul(a, b);
		ll cur = 0;
		for(int i = 0; i < si(c); ++i) {
			cur += c[i];
			ans.z.pb(cur % 1000000);
			cur /= 1000000;
		}
		ans.z = convert_base(ans.z, 6, base_digits);
		ans.trim();
		return ans;
	}
	bigint mul_simple(const bigint & v) const {
		bigint ans;
		ans.z.rs(si(z) + si(v.z));
		for(int i = 0; i < si(z); ++i)
			if(z[i]) {
				ll cur = 0;
				for(int j = 0; j < si(v.z) || cur; ++j) {
					cur += ans.z[i + j] + (ll) z[i] * (j < si(v.z) ? v.z[j] : 0);
					ans.z[i + j] = cur % base;
					cur /= base;
				}
			}
		ans.trim();
		return ans;
	}
	friend str ts(const bigint & v) {
		stringstream ss;
		ss << v;
		str s;
		ss >> s;
		return s;
	}
};

struct custom_hash { // Credits: https://codeforces.com/blog/entry/62393
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(a + FIXED_RANDOM);
	}
	template<class T> size_t operator()(T a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		return splitmix64(x(a) + FIXED_RANDOM);
	}
	template<class T, class H> size_t operator()(pair<T, H> a) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		hash<T> x;
		hash<H> y;
		return splitmix64(x(a.f) * 37 + y(a.s) + FIXED_RANDOM);
	}
};
template<class T, class H> using umap = unordered_map<T, H, custom_hash>;
template<class T> using uset = unordered_set<T, custom_hash>;

int n, k, ans;
vi a;
umap<int, int> cnt;
bitset<MOD + 3> hld;

bool check(int x) {
	bigint y = x * k;
	return y > LLONG_MAX;
}

bool check1(int x) {
	bigint y = x * k * k;
	return y > LLONG_MAX;
}

int32_t main() {
	setIO();

	cin >> n >> k;
	a.rs(n);
	trav(i, a) {
		cin >> i;
	}
	trav(i, a) {
		cnt[i]++;
	}
	for(int i = 0; i < n; ++i) {
		if(!hld[a[i]] && ((a[i] % k == 0 ? !hld[a[i] / k] : 1))) {
			if(check(a[i]) || hld[a[i] * k]) {
				ans += cnt[a[i]];
			} else if(check1(a[i]) || (!hld[a[i] * k] && hld[a[i] * k * k])) { // means that a[i] * k * k will overflow
				if(cnt[a[i]] >= cnt[a[i] * k]) {
					ans += cnt[a[i]];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				} else {
					ans += cnt[a[i] * k];
					hld[a[i]] = 1;
					hld[a[i] * k] = 1;
				}
			} else {
				if(cnt[a[i]] + cnt[a[i] * k * k] >= cnt[a[i] * k]) {
					ans += cnt[a[i]] + cnt[a[i] * k * k];
				} else {
					ans += cnt[a[i] * k];
				}
				hld[a[i]] = hld[a[i] * k] = hld[a[i] * k * k] = 1;
			}
		}
	}
	cout << ans << nl;
}


#include "bits/stdc++.h" // template by Benq
using namespace std; // Debug template credit: Benq, ramchandra

using ll = long long;
using ld = long double;
using db = double;
using str = string;
using ull = unsigned ll;

using pi = pair<ll, ll>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;

using vi = vector<ll>;
using vd = vector<db>;
using vl = vector<ll>;
using vld = vector<ld>;
using vs = vector<str>;
using vb = vector<bool>;
using vc = vector<char>;
using vpi = vector<pl>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vl>;
using vvl = vector<vl>;
using vvc = vector<vc>;

#define pb push_back
#define eb emplace_back
#define mp(a, b) make_pair(a, b)
#define f first
#define s second
#define si(a) ((int)(a).size())
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define rs resize
#define ins insert
#define nl "\n"
#define sor(a) sort(all(a))
#define res(a, n) a.rs(n); re(a)
#define int long long
#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; } )

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define rop(i, a) rep(i, 0, a)
#define per(i, a, b) for(auto i = (b) - 1; i >= (a); --i)
#define por(i, a) per(i, 0, a)
#define trav(i, a) for (auto& i: a)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> void uni(vector<T>& v) { sor(v); v.erase(unique(all(v)), end(v)); }
int cdiv(const ll& a, const ll& b) { return a / b + ((a ^ b) > 0 && a % b); } // (a / b) rounded up
int fdiv(const ll& a, const ll& b) { return a / b - ((a ^ b) < 0 && a % b); } // (a / b) rounded down
int fstTrue(function<bool(int)> f, int lo, int hi) { for(hi++; lo < hi;) { int mid = fdiv((lo + hi), 2); f(mid) ? hi = mid : lo = mid + 1; } return lo; }
int lstTrue(function<bool(int)> f, int lo, int hi) { for(lo--; lo < hi;) { int mid = fdiv((lo + hi + 1), 2); f(mid) ? lo = mid : hi = mid - 1; } return lo; }
int power(ll a, ll b, ll c) { ll res = 1; a %= c; while(b > 0) { if(b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
int power(ll a, ll b) { ll res = 1; while(b > 0) { if(b & 1) res = res * a; a = a * a; b >>= 1; } return res; }
ull modmul(ull a, ull b, const ull mod) { ll ret = a * b - mod * (ull)((ld)a * b / mod); return ret + ((ret < 0) - (ret >= (ll)mod)) * mod; }
ull modpow(ull a, ull b, const ull mod) { if(b == 0) { return 1; } ull res = modpow(a, b / 2, mod); res = modmul(res, res, mod); return b & 1 ? modmul(res, a, mod) : res; }
bool prime(ull n) { if(n < 2 || n % 6 % 4 != 1) { return n - 2 < 2; } ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022}, s = __builtin_ctzll(n - 1), d = n >> s; trav(i, A) { ull p = modpow(i, d, n), a = s; while(p != 1 && p != n - 1 && i % n && a--) { p = modmul(p, p, n); } if(p != n - 1 && a != s) { return false; } } return true; }
int pct(int x) { x = (x & 0x5555555555555555LL) + ((x >> 1) & 0x5555555555555555LL); x = (x & 0x3333333333333333LL) + ((x >> 2) & 0x3333333333333333LL); x = (x & 0x0F0F0F0F0F0F0F0FLL) + ((x >> 4) & 0x0F0F0F0F0F0F0F0FLL); return (x * 0x0101010101010101LL) >> 56; }
// uni: O(nlog(n)), cdiv: O(1), fdiv: O(1), fstTrue: O(log(hi - lo)), lstTrue: O(log(hi - lo)), gcd: O(log(min(a, b))), lcm: O(log(min(a, b))), power: O(log(b)), prime: O(sqrt(a)), pct: O(1)

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(bool b) { return b ? "true" : "false"; }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
template<class A> string ts(complex<A> c) { stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) { string res = "{"; for(int i = 0; i < si(v); i++) { res += char('0' + v[i]); } res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) { string res = ""; for(int i = 0; i < (ll)SZ; i++) { res += char('0' + b[i]); } return res; }
template<class A, class B> string ts(pair<A, B> p) { return "(" + ts(p.f) + ", " + ts(p.s) + ")"; }
template<class T> string ts(T v) { bool fst = 1; string res = "{"; for(const auto& x: v) { if(!fst) { res += ", "; } fst = 0; res += ts(x); } res += "}"; return res; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << ts(h); if(sizeof...(t)) { cerr << ", "; } DBG(t...); }
void EDBG(string names) { names = names; }
template<class H, class... T> void EDBG(string names, H h, T... t) { auto pos = names.find(','); auto first_name = names.substr(0, pos); auto rest = names.substr(pos + 1); while(rest.front() == ' ') { rest = rest.substr(1); } cerr << "[" << first_name << "]: [" << ts(h) << "]" << nl; EDBG(rest, t...); }

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define edbg(...) EDBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...) 42
#define edbg(...) 7
#endif

// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(20); }
void setIO(string s = "") { unsyncIO(); if(si(s)) { setIn(s + ".in"); setOut(s + ".out"); } }

const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7; // 998244353
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;

int n, k;
vi a, ans;

int32_t main() {
	setIO();

	cin >> n >> k;
	a.rs(n);
	trav(i, a) {
		cin >> i;
	}
	sor(a);
	for(int i = 0; i < n; ++i) {
		if(a[i] % k != 0) {
			ans.eb(a[i]);
		} else {
			if(!binary_search(all(ans), a[i] / k)) {
				ans.eb(a[i]);
			}
		}
	}
	cout << si(ans) << nl;
}


/*
ID: zhaowei10
TASK:
LANG: C++14
*/
#include "bits/stdc++.h"

using namespace std;

#ifdef LOCAL
#include "../../_library/cc/debug.h"
#define FILE "test"
#else
#define debug(...) 0
#define FILE ""
#endif

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  if (fopen(FILE ".in", "r")) {
    freopen(FILE ".in", "r", stdin);
    freopen(FILE ".out", "w", stdout);
  }

  int n, k;
  cin >> n >> k;
  vector<int64_t> a(n);
  unordered_set<int64_t> s;
  for (auto& x : a) {
    cin >> x;
    s.emplace(x);
  }
  sort(a.begin(), a.end());

  int sz = n;
  for (int i = 0; i < n; ++i) {
    if (!s.count(a[i]))
      continue;
    int64_t cur = a[i] * k;
    int cnt = 1;
    while (s.count(cur)) {
      ++cnt;
      s.erase(cur);
      cur *= k;
    }
    sz -= cnt / 2;
  }
  cout << sz;
}


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

public class template {
  static class InputReader {
    private final BufferedReader br;
    private StringTokenizer st;

    InputReader(final InputStream in) {
      br = new BufferedReader(new InputStreamReader(in));
    }

    String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (final IOException e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

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

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

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

    String nextLine() {
      final String res = null;
      while (res == null || res.isEmpty()) {
        try {
          return br.readLine();
        } catch (final IOException e) {
          e.printStackTrace();
        }
      }
      return res;
    }
  }

  public static void main(final String[] args) {
    final var in = new InputReader(System.in);
    final var out = new PrintWriter(System.out);
    new template().solve(in, out);
    out.close();
  }

  void solve(InputReader in, PrintWriter out) {
  }
}


/*
ID: zhaowei10
TASK:
LANG: C++14
*/
#include "bits/stdc++.h"

using namespace std;

#ifdef LOCAL
#include "../../_library/cc/debug.h"
#define FILE "test"
#else
#define debug(...) 0
#define FILE ""
#endif

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  if (fopen(FILE ".in", "r")) {
    freopen(FILE ".in", "r", stdin);
    freopen(FILE ".out", "w", stdout);
  }

  int n, k;
  cin >> n >> k;
  vector<int64_t> a(n);
  unordered_set<int64_t> s;
  for (auto& x : a) {
    cin >> x;
    s.emplace(x);
  }
  sort(a.begin(), a.end());

  int sz = n;
  for (int i = 0; i < n; ++i) {
    if (!s.count(a[i]))
      continue;
    int64_t cur = a[i];
    int cnt = 0;
    while (s.count(cur)) {
      ++cnt;
      s.erase(cur);
      cur *= k;
    }
    sz -= cnt / 2;
  }
  cout << sz;
}


/*
ID: zhaowei10
TASK:
LANG: C++14
*/
#include "bits/stdc++.h"

using namespace std;

#ifdef LOCAL
#include "../../_library/cc/debug.h"
#define FILE "test"
#else
#define debug(...) 0
#define FILE ""
#endif

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  if (fopen(FILE ".in", "r")) {
    freopen(FILE ".in", "r", stdin);
    freopen(FILE ".out", "w", stdout);
  }

  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  unordered_set<int> s;
  for (auto& x : a) {
    cin >> x;
    s.emplace(x);
  }
  sort(a.begin(), a.end());

  int sz = n;
  for (int i = 0; i < n; ++i) {
    if (!s.count(a[i]))
      continue;
    int cur = a[i] * k;
    int cnt = 1;
    while (s.count(cur)) {
      ++cnt;
      s.erase(cur);
      cur *= k;
    }
    sz -= cnt / 2;
  }
  cout << sz;
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <iomanip>
#include <set>
#include <stack>
#define ll long long int
#define endln "\n"
#define goodluck_code() main()
#define _Open_Minded_Short_Code_ return 0;
using namespace std;

int goodluck_code(){
	ll n , k;
	cin >> n >> k;
	vector <ll> ve(n);
	vector <ll> ve1;
	vector <ll> ve2;
	for(int i=0;i<n;i++){
		cin >> ve[i];
	}
	sort(ve.begin(),ve.end());
	ll sum = 0 , dem= 1;
	int i = 0 , j = 0;
	for(i=0;i<n;i++){
		if(ve[i] != 'x'){
			sum = ve[i] * k;
			dem = 0;
			for(j=0;j<n;j++){
				if(sum == ve[j]){
					dem = 0;
					break;
				}else{
					dem = 1;
				}
			}
		}
		if(dem == 1){
			ve[j] = 'x';
			ve1.push_back(ve[i]);
		}else{
			ve2.push_back(ve[i]);
		}
	}
	ll dev = 0 , dem2 = 0;
	for(int i=0;i<ve2.size();i++){
		dev = ve2[i] * k;
		dem2 = 0;
		for(int j=0;j<ve1.size();j++){
			if(dev == ve1[j]){
				dem2 = 0;
				break;
			}else{
				dem2 = 1;
			}
		}
		if(dem2 == 1){
			ve1.push_back(dev);
		}
	}
	int huy = 0 , dem3 = 0 ;
	int fo = ve1.size();
	for(int i=0;i<ve1.size();i++){
		huy = ve1[i] * k;
		for(int j=0;j<n;j++){
			if(huy == ve1[j]){
				ve1[j] = 'x';
				fo--;
				break;
			}
		}
	}
	cout<<fo<<endln;
	_Open_Minded_Short_Code_
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <iomanip>
#include <set>
#include <stack>
#define ll long long int
#define endln "\n"
#define goodluck_code() main()
#define _Open_Minded_Short_Code_ return 0;
using namespace std;

int goodluck_code(){
	ll n , k;
	cin >> n >> k;
	vector <ll> ve(n);
	set <ll> se;
	map <ll,ll> mp;
	for(int i=0;i<n;i++){
		cin >> ve[i];
		se.insert(ve[i]);
	}
	sort(ve.begin(),ve.end());
	ll x = ve.back();
	set <ll> :: iterator it;
	map <ll,ll> :: iterator fi;
	ll d = 0 , tamp = 0 , res = 0;
	for(it = se.begin();it != se.end();it++){
		d = *it *k;
		tamp++;
		if(d > x){
			res = n-(tamp - 1);
			break;
		}
	}
	if(res + 1 > n){
		cout<<res<<endln;
	}else{
		cout<<res+1<<endln;
	}
	_Open_Minded_Short_Code_
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <iomanip>
#include <set>
#include <stack>
#define ll long long int
#define endln "\n"
#define goodluck_code() main()
#define _Open_Minded_Short_Code_ return 0;
using namespace std;

int goodluck_code(){
	ll n , k;
	cin >> n >> k;
	vector <ll> ve(n);
	set <ll> se;
	map <ll,ll> mp;
	for(int i=0;i<n;i++){
		cin >> ve[i];
		se.insert(ve[i]);
	}
	sort(ve.begin(),ve.end());
	ll x = ve.back();
	set <ll> :: iterator it;
	map <ll,ll> :: iterator fi;
	ll d = 0 , tamp = 0 , res = 0;
	for(it = se.begin();it != se.end();it++){
		d = *it *k;
		tamp++;
		if(d > x){
			res = n-(tamp - 1);
			break;
		}
	}
	cout<<res+1<<endln;
	_Open_Minded_Short_Code_
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <iomanip>
#include <set>
#include <stack>
#define ll long long int
#define endln "\n"
#define goodluck_code() main()
#define _Open_Minded_Short_Code_ return 0;
using namespace std;

int goodluck_code(){
	ll n , k;
	cin >> n >> k;
	vector <ll> ve(n);
	vector <ll> vec;
	vector <ll> vet;
	set <ll> se;
	set <ll> :: iterator si;
	map <ll,ll> mp;
	map <ll,ll> mp2;
	map <ll,ll> ::iterator mi;
	for(int i=0;i<n;i++){
		cin >> ve[i];
		se.insert(ve[i]);
	}
	sort(ve.begin(),ve.end());
//	for(int i=0;i<n;i++){
//		cout<<ve[i]<<" ";
//	}
//	cout<<endln;
	ll x = ve.back();
	if(k == 1){
		cout<<se.size()<<endln;
		return 0;
	}
	if(se.size() == 1){
		cout<<"1"<<endln;
		return 0;
	}else{
		ll re = 0 , tamp = 0 , vt;
		for(si = se.begin();si != se.end();si++){
			vec.push_back(*si);
			mp[*si]++;
		}
		for(int i=0;i<vec.size();i++){

			if(vec[i] != -1){
				re = vec[i] * k;
				mp[re]++;
				if(mp[re] == 2){
					mp[re] = -1;
				}
			}
		}
		int dem = 0;
		for(mi = mp.begin();mi != mp.end();mi++){
			if(mi->first > x){
				dem++;
			}
		}
		cout<<dem + 1<<endln;

	}
	_Open_Minded_Short_Code_
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <map>
#include <iomanip>
#include <set>
#include <stack>
#define ll long long int
#define endln "\n"
#define goodluck_code() main()
#define _Open_Minded_Short_Code_ return 0;
using namespace std;

int goodluck_code(){
	ll n , k;
	cin >> n >> k;
	vector <ll> ve(n);
	vector <ll> ves;
	vector <ll> vet;
	set <ll> se;
	set <ll> :: iterator si;
	for(int i=0;i<n;i++){
		cin >> ve[i];
		se.insert(ve[i]);
	}
	sort(ve.begin(),ve.end());
	if(se.size() == 1){
		cout<<"1"<<endln;
		return 0;
	}
	ll maxv = ve.back();
//	for(int i=0;i<n;i++){
//		cout<<ve[i]<<" ";
//	}
//	cout<<endln;
	ll q = 0 , vitri = 0 ,tamp = 0;
	for(si = se.begin() ; si != se.end();si++){
		ves.push_back(*si);
		q = *si *k;
		tamp++;
		if(q >= maxv){
			vitri = n - tamp;
			break;
		}
	}
	if(vitri == 0){
		cout<<n<<endln;
	}else{
		ll muti = 0 , dem = 0 , dem1 = 0;
		sort(ves.begin(),ves.end());
		for(int i=0;i<ves.size();i++){
			if(ves[i] != -1){
				dem1 = 0;
				muti = ves[i] * k;
				for(int j=0;j<=ves.size();j++){
					if(muti == ves[j]){
				     	vet.push_back(ves[i]);
						ves[j] = -1;
						ves[i] = -1;
						break;
					}
				}
			}
		}
		cout<<vitri + vet.size()<<endln;
	}
	_Open_Minded_Short_Code_
}