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;
inline void print(int n) {
  if (n == 0) {
    putchar('0');
    putchar('\n');
  } else if (n == -1) {
    putchar('-');
    putchar('1');
    putchar('\n');
  } else {
    char buf[11];
    buf[10] = '\n';
    int i = 9;
    while (n) {
      buf[i--] = n % 10 + '0';
      n /= 10;
    }
    while (buf[i] != '\n') putchar(buf[++i]);
  }
}
int read() {
  int cc = getc(stdin);
  for (; cc < '0' || cc > '9';) cc = getc(stdin);
  int ret = 0;
  for (; cc >= '0' && cc <= '9';) {
    ret = ret * 10 + cc - '0';
    cc = getc(stdin);
  }
  return ret;
}
long long power(long long num, long long g) {
  if (g == 0) return 1;
  if (g % 2 == 1) return (num * power((num * num), g / 2));
  return power((num * num), g / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  map<long long, long long> mp1;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long g;
    cin >> g;
    long long h = 1, r = 1;
    for (long long j = 2; j <= sqrt(g); j++) {
      if (g % j == 0) {
        long long f = 0;
        while (g % j == 0) g /= j, f++;
        f %= k;
        r *= power(j, f);
        f = k - f;
        f %= k;
        for (int q = 0; q < f; q++) {
          if (h > 10000000000LL) break;
          h *= j;
        }
      }
    }
    if (g > 1) {
      for (int j = 0; j < k - 1; j++) {
        if (h > 10000000000LL) break;
        h *= g;
      }
      r *= g;
    }
    if (mp1.find(h) != mp1.end()) {
      ans += mp1[h];
    }
    if (h > 10000000000LL)
      continue;
    else if (mp1.find(r) == mp1.end())
      mp1[r] = 1;
    else
      mp1[r]++;
  }
  cout << ans << endl;
  return 0;
}
