#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef map<LL, int> :: iterator Mit;

const int N = 2500;

int n, pcnt, ans, pr[N / 2]; 
LL x, y;
map<LL, int> mp, vis;

inline bool is_prim(LL x) {
	LL y = sqrt(x);
	return y * y == x;
}
void pre(int n) {
	for(int i = 2, f = 1; i <= n; ++i, f = 1) {
		for(int j = 2; j < i && f; ++j)
			if(i % j == 0) f = 0;
		if(f) pr[++pcnt] = i;
	}
}
LL calc(LL x) {
	LL y = 1;
	for(int i = 1; i <= pcnt; ++i) {
		if(x % pr[i]) continue;
		int cnt = 0;
		while(x % pr[i] == 0)
			x /= pr[i], ++cnt;
		cnt %= 3;
		if(!cnt) continue;
		for(int j = 1; j <= 3 - cnt; ++j)
			y *= pr[i];
	}
	if(x == 1) return y;
	y *= is_prim(x) ? (LL) sqrt(x) : x * x;
	return y;
}

int main() {
	scanf("%d", &n);
	pre(N);
	for(int k = 1; k <= n; ++k) {
		scanf("%lld", &x);
		y = 1;
		for(int i = 1; i <= pcnt; ++i) {
			if(x % pr[i]) continue;
			int cnt = 0;
			while(x % pr[i] == 0)
				x /= pr[i], ++cnt;
			cnt %= 3;
			for(int j = 1; j <= cnt; ++j)
				y *= pr[i];
		}
		y *= x;
		mp[y]++;
	}
	for(Mit it = mp.begin(); it != mp.end(); ++it) {
		x = (*it).first;
		if(vis[x]) continue;
		y = calc(x);
		if(x == y) ++ans;
		else {
			vis[y] = 1;
			ans += max(mp[x], mp[y]);
		}
	}
	printf("%d\n", ans);
	return 0;
}
