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;
long long fexp(long long x, long long y) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans *= x;
    x *= x;
    if (x > 1e10 + 5) return 1e10 + 5 + 1;
    y >>= 1;
  }
  return ans;
}
class Solution {
 public:
  void solve() {
    vector<int> primes = {2, 3, 5, 7, 11, 13};
    for (int i = 17; i * i <= 100005; i += 2) {
      bool is_prime = true;
      for (int j = 0; primes[j] * primes[j] <= i; ++j) {
        if (i % primes[j] == 0) {
          is_prime = false;
          break;
        }
      }
      if (is_prime) primes.emplace_back(i);
    }
    int n, k;
    scanf("%d%d", &n, &k);
    vector<long long> coeff = {1};
    for (int i = 2; i < 100005; ++i) {
      long long val = fexp(i, k);
      if (val > 1e10 + 5) break;
      coeff.emplace_back(val);
    }
    unordered_map<int, int> cnt;
    for (int i = 0; i < n; ++i) {
      int a;
      scanf("%d", &a);
      cnt[a]++;
    }
    if (k <= 3) {
      unordered_map<int, unordered_map<int, int>> factor;
      for (const auto &p : cnt) {
        int num = p.first;
        for (int prime : primes) {
          while (num % prime == 0) {
            num /= prime;
            factor[p.first][prime]++;
          }
          if (prime * prime >= num) break;
        }
        if (num != 1) factor[p.first][num]++;
      }
      long long ans = 0;
      for (const auto &p : cnt) {
        long long companion = 1;
        bool ok = true;
        for (const auto &q : factor[p.first]) {
          long long need = fexp(q.first, (k - q.second % k) % k);
          if (need > 100005) {
            ok = false;
            break;
          }
          companion *= need;
          if (companion > 100005) {
            ok = false;
            break;
          }
        }
        if (ok) {
          for (long long i : coeff) {
            long long val = companion * i;
            if (val > p.first) break;
            if (cnt.find(val) != cnt.end()) {
              long long num = (long long)cnt[val] * p.second;
              if (val == p.first)
                num = (long long)cnt[val] * (cnt[val] - 1) / 2;
              ans += num;
            }
          }
        }
      }
      printf("%lld", ans);
      return;
    }
    long long ans = 0;
    for (const auto &p : cnt) {
      for (long long i : coeff) {
        if (i % p.first == 0) {
          long long val = i / p.first;
          if (val > p.first) break;
          if (cnt.find(val) != cnt.end()) {
            long long num = (long long)cnt[val] * p.second;
            if (val == p.first) num = (long long)cnt[val] * (cnt[val] - 1) / 2;
            ans += num;
          }
        }
      }
    }
    printf("%lld", ans);
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution solution = Solution();
  solution.solve();
}
