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>
struct outputer;
struct outputable {};
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 100000;
const int X = 100000;
struct Input {
  int n, m;
  int a[N];
  bool read() {
    if (!(cin >> n >> m)) {
      return 0;
    }
    for (int i = int(0); i < int(n); ++i) {
      scanf("%d", &a[i]);
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  int64_t ans;
  void write() { cout << ans << endl; }
};
namespace Main {
struct Solution : Data {
  int p[X + 1];
  int64_t q[X + 1], r[X + 1];
  int64_t calc_q(int i) {
    if (i < 2) {
      return i;
    }
    int t = p[i];
    int cnt = 0;
    while (i % t == 0) {
      cnt++;
      i /= t;
    }
    int64_t res = calc_q(i);
    for (int j = int(0); j < int(cnt % m); ++j) {
      res *= t;
    }
    return res;
  }
  int64_t calc_r(int i) {
    if (i < 2) {
      return i;
    }
    int t = p[i];
    int cnt = 0;
    while (i % t == 0) {
      cnt++;
      i /= t;
    }
    int64_t res = calc_r(i);
    for (int j = int(0); j < int((m - cnt % m) % m); ++j) {
      res *= t;
      if (res > X) {
        return 0;
      }
    }
    return res;
  }
  map<int64_t, int> cnt_q;
  void solve() {
    memset(p, 0, sizeof p);
    p[0] = p[1] = -1;
    for (int i = int(0); i < int(X + 1); ++i) {
      if (!p[i]) {
        for (int j = i; j <= X; j += i) {
          p[j] = i;
        }
      }
      q[i] = calc_q(i);
      r[i] = calc_r(i);
    };
    ;
    ans = 0;
    for (int i = int(0); i < int(n); ++i) {
      ;
      ans += cnt_q[r[a[i]]];
      cnt_q[q[a[i]]]++;
    }
  }
  void clear() { *this = Solution(); }
};
}  // namespace Main
Main::Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
