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;
template <typename T>
bool get_int(T &x) {
  char t = getchar();
  bool neg = false;
  x = 0;
  for (; (t > '9' || t < '0') && t != '-' && t != EOF; t = getchar())
    ;
  if (t == '-') neg = true, t = getchar();
  if (t == EOF) return false;
  for (; t <= '9' && t >= '0'; t = getchar()) x = x * 10 + t - '0';
  if (neg) x = -x;
  return true;
}
template <typename T>
void print_int(T x) {
  if (x < 0) putchar('-'), x = -x;
  short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
const int inf = 0x3f3f3f3f;
const long long Linf = 1ll << 61;
const double pi = acos(-1.0);
const int maxn = 100111;
int n, k, a[maxn], cnt[maxn];
vector<int> dv[maxn];
int main() {
  (get_int(n) && get_int(k));
  for (int i = 1; i <= n; i++) get_int(a[i]);
  for (int i = 2; i < maxn; i++)
    if ((int)dv[i].size() == 0) {
      for (int j = i; j < maxn; j += i) dv[j].push_back(i);
    }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long need = 1, is = 1;
    for (auto v : dv[a[i]]) {
      int cnt = 0, tmp = a[i];
      while (tmp % v == 0) {
        cnt++;
        tmp /= v;
      }
      cnt %= k;
      for (int j = 0; j < cnt; j++) is *= v;
      if (k > 40)
        need = maxn - 1;
      else if (cnt) {
        for (int j = 0; j < k - cnt; j++) need = min(maxn - 1ll, need * v);
      }
    }
    ans += cnt[need];
    cnt[is]++;
  }
  print_int(ans), puts("");
  return 0;
}
