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 MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int ddx[] = {2, 2, -2, -2, 1, 1, -1, -1}, ddy[] = {1, -1, 1, -1, 2, -2, 2, -2};
vector<int> t = {0};
map<vector<pair<int, int> >, int> M;
int n, k;
vector<pair<int, int> > op(vector<pair<int, int> > &v) {
  vector<pair<int, int> > p;
  for (auto P : v) p.push_back(make_pair(P.first, k - P.second));
  return p;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1;; i++) {
    long long c = 1;
    for (int(j) = (1); (j) <= (k); (j) += (1)) {
      c *= i;
      if (c > 100000) {
        c = -1;
        break;
      }
    }
    if (c == -1) break;
    t.push_back(c);
  }
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    long long x;
    scanf("%lld", &x);
    for (int(k) = (2); (k) <= ((int)t.size() - 1); (k) += (1))
      while (x % t[k] == 0) x /= t[k];
    vector<pair<int, int> > vv;
    for (int k = 2; k * k <= x; k++) {
      if (x % k == 0) {
        int cc = 0;
        while (x % k == 0) {
          cc++;
          x /= k;
        }
        vv.push_back(make_pair(k, cc));
      }
    }
    if (x != 1) vv.push_back(make_pair(x, 1));
    M[vv]++;
  }
  long long ans = 0;
  for (auto it = M.begin(); it != M.end(); it++) {
    auto t = it->first;
    if (t.empty())
      ans += 1LL * it->second * (it->second - 1);
    else {
      auto vp = op(t);
      if (it->first == vp)
        ans += 1LL * it->second * (it->second - 1);
      else
        ans += 1LL * it->second * M[vp];
    }
  }
  printf("%lld", ans / 2);
}
