#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pi;

const ll N = 1e5 + 10;

map<pi, ll> mp;
ll pri[N], vis[N], tot = 0;
ll n, a[N];

void get_prime(ll t) {
  for (ll i = 2; i <= t; i++) {
    if (!vis[i]) {
      pri[++tot] = i;
    }
    for (ll j = 1; j <= tot && i * pri[j] <= t; j++) {
      vis[i * pri[j]] = 1;
      if (i % pri[j] == 0) {
        break;
      }
    } 
  }
}

void solve(ll vl) {
  // cout<<vl<<"+++"<<endl;
  ll pre = 1, suf = 1;
  for (int i = 1; i <= tot && pri[i] * pri[i] * pri[i] <= vl; i++) {
    int cnt = 0;
    while (vl % pri[i] == 0) {
      vl /= pri[i];
      cnt++;
    }
    cnt %= 3;
    if (cnt == 1) {
      pre *= pri[i];
    } else if (cnt == 2) {
      suf *= pri[i];
    }
  }
  ll now = sqrt(vl);
  if (now * now == vl) {
    suf *= now;
  } else {
    pre *= vl;
  }
  mp[pi(pre, suf)]++;
}

int main() {
  get_prime(3000);
  scanf("%d", &n);
  int ans = 0;
  for (ll i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    solve(a[i]);
  }
  for (auto cur : mp) {
    ll w1 = cur.first.first, w2 = cur.first.second;
    if (w1 > w2 && mp[pi(w2, w1)]) continue;
    if (w1 == w2) {
      ans++;
    } else {
      ans += max(mp[pi(w1, w2)], mp[pi(w2, w1)]);
    }
  }
  printf("%d\n", ans);
  return 0;
}