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 int iinf = 1 << 29;
const long long inf = 1ll << 60;
const long long mod = 1e9 + 7;
void GG() {
  cout << "No\n";
  exit(0);
}
long long mpow(long long a, long long n, long long mo = mod) {
  long long re = 1;
  while (n > 0) {
    if (n & 1) re = re * a % mo;
    a = a * a % mo;
    n >>= 1;
  }
  return re;
}
long long inv(long long b, long long mo = mod) {
  if (b == 1) return b;
  return (mo - mo / b) * inv(mo % b) % mo;
}
const int maxn = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  vector<int> ap(100005);
  vector<int> other(100005);
  int n;
  cin >> n;
  int k;
  cin >> k;
  bool tb = 0;
  if (k >= 33) tb = 1;
  k = min(k, 33);
  vector<int> a(n);
  vector<long long> out;
  vector<long long> pl;
  for (long long i = 2; i <= 10000000000; i++) {
    long long mo = pow(i, k);
    if (mo > 10000000000) break;
    out.push_back(mo);
    if (mo <= 100000) pl.push_back(mo);
  }
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
    for (int j = ((int)pl.size() - 1); j >= 0; j--) {
      if (a[i] % pl[j] == 0) a[i] /= pl[j];
    }
    ap[a[i]]++;
    if (k == 3) {
      if (other[a[i]]) continue;
      other[a[i]] = 1;
      long long tmp = a[i];
      for (int j = (2); j < (1 + sqrt(a[i])); j++) {
        int nat = 0;
        while (tmp % j == 0) tmp /= j, nat++;
        if (nat == 1) other[a[i]] *= (long long)j * j;
        if (nat == 2) other[a[i]] *= j;
      }
      if (tmp) other[a[i]] *= tmp * tmp;
    }
  }
  long long re = 0;
  for (int i = (1); i < (100005); i++) {
    if (ap[i] == 0) continue;
    if (i == 1) {
      re += (long long)ap[i] * (ap[i] - 1) / 2;
      continue;
    }
    if (tb) break;
    if (k > 3) {
      for (int j = 0; j < ((int)out.size()); j++) {
        if (out[j] % i == 0) {
          long long oth = out[j] / i;
          if (oth < i) re += (long long)ap[oth] * ap[i];
          if (oth == i) re += (long long)ap[i] * (ap[i] - 1) / 2;
          break;
        }
      }
    } else if (k == 2) {
      re += (long long)ap[i] * (ap[i] - 1) / 2;
    } else {
      long long oth = other[i];
      if (oth < i) re += (long long)ap[oth] * ap[i];
      if (oth == i) re += (long long)ap[i] * (ap[i] - 1) / 2;
    }
  }
  cout << re << endl;
}
