You are given n positive integers a_1, …, a_n, and an integer k ≥ 2. Count the number of pairs i, j such that 1 ≤ i < j ≤ n, and there exists an integer x such that a_i ⋅ a_j = x^k.

Input

The first line contains two integers n and k (2 ≤ n ≤ 10^5, 2 ≤ k ≤ 100).

The second line contains n integers a_1, …, a_n (1 ≤ a_i ≤ 10^5).

Output

Print a single integer — the number of suitable pairs.

Example

Input


6 3
1 3 9 8 24 1


Output


5

Note

In the sample case, the suitable pairs are:

  * a_1 ⋅ a_4 = 8 = 2^3;
  * a_1 ⋅ a_6 = 1 = 1^3;
  * a_2 ⋅ a_3 = 27 = 3^3;
  * a_3 ⋅ a_5 = 216 = 6^3;
  * a_4 ⋅ a_6 = 8 = 2^3.
#include <bits/stdc++.h>
using namespace std;
const long long BIG = 1000000000000000000LL;
void solve();
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
const long long borne = (long long)(1e5) + 5;
long long tab[borne];
long long pdiv[borne];
long long occ[borne];
long long nbElem, ex;
void spec() {
  for (long long p = 2; p < borne; ++p) {
    if (pdiv[p] > 0) continue;
    for (long long c = 2; p * c < borne; ++c) {
      pdiv[p * c] = p;
    }
  }
  long long rep = 0;
  multiset<vector<long long>> vu;
  for (long long iPos = (0); iPos < (nbElem); ++iPos) {
    set<long long> cur;
    long long val = tab[iPos];
    rep += occ[val] * (occ[val] - 1) / 2;
    while (val > 1) {
      long long x = pdiv[val];
      if (x == 0) x = val;
      val /= x;
      if (cur.find(x) != cur.end())
        cur.erase(x);
      else
        cur.insert(x);
    }
    vector<long long> dc;
    for (long long x : cur) {
      dc.push_back(x);
    }
    rep += occ[tab[iPos]] * vu.count(dc);
    for (long long i = (0); i < (occ[tab[iPos]]); ++i) vu.insert(dc);
  }
  cout << rep << "\n";
}
void tout() {
  long long rep = 0;
  for (long long small = 1;; small++) {
    long long big = 1;
    for (long long i = (0); i < (ex); ++i) big *= small;
    if (big > borne * borne) break;
    long long lo = 0, ri = nbElem - 1;
    while (lo <= ri) {
      if (tab[lo] * tab[ri] == big) {
        long long x = occ[tab[lo]] * occ[tab[ri]];
        if (lo == ri) x = occ[tab[lo]] * (occ[tab[lo]] - 1) / 2;
        rep += x;
        ++lo;
        --ri;
      } else if (tab[lo] * tab[ri] < big)
        ++lo;
      else
        --ri;
    }
  }
  cout << rep << "\n";
}
void solve() {
  cin >> nbElem >> ex;
  set<long long> wo;
  for (long long i = (0); i < (nbElem); ++i) {
    long long x;
    cin >> x;
    wo.insert(x);
    occ[x]++;
  }
  nbElem = wo.size();
  long long indPos = 0;
  for (long long x : wo) tab[indPos++] = x;
  if (ex == 2)
    spec();
  else
    tout();
}
