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;
void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
int ctz(unsigned x) { return __builtin_ctz(x); }
int ctzll(unsigned long long x) { return __builtin_ctzll(x); }
int clz(unsigned x) { return __builtin_clz(x); }
int clzll(unsigned long long x) { return __builtin_clzll(x); }
int popcnt(unsigned x) { return __builtin_popcount(x); }
int popcntll(unsigned long long x) { return __builtin_popcountll(x); }
int bsr(unsigned x) { return 31 ^ clz(x); }
int bsrll(unsigned long long x) { return 63 ^ clzll(x); }
vector<pair<unsigned, unsigned> > factorize(unsigned n, unsigned k) {
  vector<pair<unsigned, unsigned> > res;
  if (int e2 = ctz(n)) {
    if (e2 % k) res.emplace_back(2, e2 % k);
    n >>= e2;
  }
  for (unsigned p = 3;; p += 2) {
    unsigned q = n / p, r = n % p, e = 0;
    if (q < p) break;
    while (!r) {
      n = q;
      q = n / p;
      r = n % p;
      ++e;
    }
    if (e % k) res.emplace_back(p, e % k);
  }
  if (n > 1) res.emplace_back(n, 1);
  return res;
}
int main() {
  canhazfast();
  int n, k;
  long long ans = 0;
  map<vector<pair<unsigned, unsigned> >, int> mp;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    unsigned a;
    cin >> a;
    vector<pair<unsigned, unsigned> > fsa = factorize(a, k);
    vector<pair<unsigned, unsigned> > fsb = fsa;
    for (pair<unsigned, unsigned> &f : fsb) {
      f.second = k - f.second;
    }
    int cnt = mp.count(fsb) ? mp[fsb] : 0;
    ans += cnt;
    ++mp[fsa];
  }
  cout << ans << '\n';
  return 0;
}
