#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 100005;
const int M = 1000000007;

int n;

int prime[N];
void getPrime() {
  for (int i = 2; i < N; i++) {
    if (!prime[i]) { prime[++prime[0]] = i; }
    for (int j = 1; j <= prime[0] && prime[j] * i < N; j++) {
      prime[prime[j] * i] = 1;
      if (i % prime[j] == 0) { break; }
    }
  }
}

inline ll cube(ll x) { return x * x * x; }

int main() {
  getPrime();
  while (~scanf("%d", &n)) {
    int cnt = 0; ll x;
    map<ll, int> mp;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &x);
      ll t = x;
      for (int i = 1; i <= prime[0] && prime[i] < 1000; i++) {
        while (t % cube(prime[i]) == 0) { t /= cube(prime[i]); }
      }
      if (t == 1) { cnt++; }
      else { mp[t]++; }
    }
    int ans = n - max(0, cnt - 1);
    set<ll> st;
    for (auto &p : mp) {
      if (st.find(p.first) != st.end()) { continue; }
      ll t = p.first * p.first;
      for (int i = 1; i <= prime[0] && prime[i] < 1000; i++) {
        while (t % cube(prime[i]) == 0) { t /= cube(prime[i]); }
      }
      if (mp.find(t) != mp.end()) { ans -= min(p.second, mp[t]); }
      st.insert(t);
    }
    printf("%d\n", ans);
  }
}
