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 maxn = 1e5 + 43;
const int maxm = 2e3 + 43;
const int maxlog = 22;
const int mod = 1e9 + 7;
const int sq = 340;
const int inf = 1e9;
const long double PI = 3.141592653589793238463;
long long cnt[10 * maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
  long long n, k;
  cin >> n >> k;
  if (k != 2) {
    vector<long long> nums;
    for (long long i = 1; i <= (long long)(1e5 + 3); i++) {
      long long cur = 1;
      for (long long j = 1; j <= k; j++) {
        cur *= i;
        if (cur > 1e10 + 34) break;
      }
      if (cur <= 1e10 + 34)
        nums.push_back(cur);
      else
        break;
    }
    long long ans = 0;
    for (long long i = 1; i <= n; i++) {
      long long x;
      cin >> x;
      for (long long j = 0; j < nums.size(); j++) {
        long long y = nums[j];
        if (y % x == 0) {
          if (y / x < maxn) {
            ans += cnt[y / x];
          }
        }
      }
      cnt[x]++;
    }
    cout << ans << endl;
    return 0;
  } else {
    long long ans = 0;
    map<vector<long long>, long long> ma;
    for (long long i = 0; i < n; i++) {
      long long x;
      cin >> x;
      vector<long long> v;
      long long y = x;
      for (long long i = 2; i * i <= x; i++) {
        if (y % i == 0) {
          bool flag = false;
          while (y % i == 0) {
            y /= i;
            flag ^= 1;
          }
          if (flag) v.push_back(i);
        }
      }
      if (y != 1) v.push_back(y);
      sort(v.begin(), v.end());
      ans += ma[v];
      ma[v]++;
    }
    cout << ans << endl;
    return 0;
  }
  return 0;
}
