#include <bits/stdc++.h>

typedef long long ll;
typedef std::pair <ll, ll> pr;
typedef std::map <ll, ll> map;
const int N = 100054;
const ll INF = 0x3f3f3f3f3f3f3f3fll;

int n;
int pn = 0, c[2254], p[354];
map M;

inline ll min(const ll x, const ll y) {return x < y ? x : y;}
inline int max(const int x, const int y) {return x < y ? y : x;}

void sieve(int n) {
	int i, j, v;
	memset(c, -1, sizeof c);
	for (i = 2; i <= n; ++i) {
		if (!~c[i]) p[pn] = i, c[i] = pn++;
		for (j = 0; (v = i * p[j]) <= n && j <= c[i]; ++j) c[v] = j;
	}
}

ll cubic_characteristic(ll x) {
	int i; ll C;
	for (i = 0; i < pn && (C = (ll)p[i] * p[i] * p[i]) <= x; ++i)
		for (; !(x % C); x /= C);
	return x;
}

ll Compl(ll x) {
	int i; ll t, y = 1;
	for (i = 0; i < pn && p[i] <= x; ++i)
		x % (p[i] * p[i]) ? (x % p[i] ? 0 : (y *= p[i] * p[i], x /= p[i])) : (y *= p[i], x /= p[i] * p[i]);
	return t = sqrt(x), y * min(INF / y, t * t == x ? t : x * x);
}

int main() {
	int i, ans = 0; ll x;
	map::iterator it;
	scanf("%d", &n), sieve(2253);
	for (i = 0; i < n; ++i) scanf("%lld", &x), ++M[cubic_characteristic(x)];
	for (const pr &e : M)
		if (e.first == 1) ++ans;
		else if ((it = M.find(x = Compl(e.first))) == M.end()) ans += e.second;
		else if (e.first < x) ans += max(e.second, it->second);
	printf("%d\n", ans);
	return 0;
}