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>
class RangeCountExact {
  map<T, int> mp;
  vector<vector<int>> idxs;
  int get(int r, T x) {
    if (mp.count(x) == 0) return 0;
    int a = mp[x];
    return lower_bound(idxs[a].begin(), idxs[a].end(), r) - idxs[a].begin();
  }

 public:
  RangeCountExact(const vector<T> &as) {
    for (auto &a : as) mp[a];
    int N = 0;
    for (auto &p : mp) {
      p.second = N++;
    }
    idxs.resize(N);
    for (int i = 0; i < as.size(); i++) {
      idxs[mp[as[i]]].push_back(i);
    }
  }
  int get(int l, int r, T x) { return get(r, x) - get(l, x); }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<set<int>> as;
  map<int, int> kesu;
  for (int i = 0; i < n; i++) {
    set<int> ps;
    int a;
    cin >> a;
    for (int j = 2; j * j <= a; j++) {
      if (a % j == 0) {
        int cnt = 0;
        while (a % j == 0) {
          a /= j;
          cnt++;
        }
        cnt %= k;
        if (cnt) {
          int b = 1;
          for (int q = 0; q < cnt; q++) b *= j;
          ps.insert(b);
          long long c = 1;
          bool ok = true;
          for (int q = 0; q < k - cnt; q++) {
            c *= j;
            if (c > 1e5) {
              ok = false;
              break;
            }
          }
          if (ok) {
            kesu[b] = c;
            kesu[c] = b;
          }
        }
      }
    }
    if (a > 1) {
      ps.insert(a);
      long long c = 1;
      bool ok = true;
      for (int q = 0; q < k - 1; q++) {
        c *= a;
        if (c > 1e5) {
          ok = false;
          break;
        }
      }
      if (ok) {
        kesu[a] = c;
        kesu[c] = a;
      }
    }
    as.push_back(ps);
  }
  RangeCountExact<set<int>> cnt(as);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    set<int> need;
    bool ok = true;
    for (auto &p : as[i]) {
      if (kesu.count(p) == 0) {
        ok = false;
        break;
      }
      need.insert(kesu[p]);
    }
    if (ok) ans += cnt.get(i + 1, n, need);
  }
  cout << ans << endl;
}
