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;
const long long INF = 1000000001;
const long long INF2 = 1000000000000000001LL;
const double PI = acos(-1);
const double ERR = 1e-10;
const int N = 100005;
long long n, k;
int a[N];
vector<pair<int, char> > v1[N];
vector<pair<int, char> > v[N];
const int PN = 100005;
bool isprime[PN];
void primechk() {
  for (int i = 2; i < PN; i++) isprime[i] = true;
  for (long long i = 2; i < PN; i++)
    if (isprime[i]) {
      v[i].push_back(pair<int, char>(i, 1));
      for (long long j = i * i; j < PN; j += i) isprime[j] = false;
      for (long long j = 2 * i; j < PN; j += i) {
        v[j].push_back(pair<int, char>(i, 1));
        long long j1 = j / i;
        while (j1 != 0 && j1 % i == 0) {
          j1 /= i;
          v[j][(int)v[j].size() - 1].second++;
        }
      }
    }
}
map<vector<pair<int, char> >, long long> m;
int main() {
  primechk();
  scanf("%lld", &n);
  scanf("%lld", &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    vector<pair<int, char> > vv;
    vv.push_back(pair<int, char>(0, 0));
    unsigned long long m1 = 1;
    for (int j = 0; j < v[a[i]].size(); j++) {
      pair<int, char> now = v[a[i]][j];
      if (now.second % k != 0) {
        now.second = now.second % k;
        vv.push_back(now);
      }
    }
    if (m.find(vv) == m.end()) {
      m[vv] = 1;
    } else
      m[vv]++;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    vector<pair<int, char> > vv;
    vector<pair<int, char> > vv1;
    vv.push_back(pair<int, char>(0, 0));
    vv1.push_back(pair<int, char>(0, 0));
    unsigned long long m1 = 1, m2 = 1;
    for (int j = 0; j < v[a[i]].size(); j++) {
      pair<int, char> now = v[a[i]][j];
      if (now.second % k != 0) {
        now.second = now.second % k;
        vv.push_back(now);
        vv1.push_back(now);
        vv[(int)vv.size() - 1].second = k - vv[(int)vv.size() - 1].second;
      }
    }
    m[vv1]--;
    if (m.find(vv) != m.end()) {
      ans += m[vv];
    }
    m[vv1]++;
  }
  printf("%lld", ans / 2);
  return 0;
}
