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

const int magic = 2500;
const long long inf = 4e18;

bool np[magic];
vector<int> prm;

bool issqr(long long x) {
	long long y = (long long) (pow(x, (1 / 2)) + 0.5);
	return 1ll * y * y == x;
}

bool iscub(long long x) {
	long long y=  (long long) (pow(x, 1 / 3) + 0.5);
	return 1ll * y * y * y == x;
}

void sieve() {
	np[0] = np[1] = 1;
	for (int i = 2; i < magic; ++i) if (!np[i]) {
		prm.push_back(i);
		for (int j = i + i; j < magic; j += i) np[j] = 1;
	}
}

int n;
long long a[100005];
map<long long,int> f, was;

void calc(int id) {
	for (int x : prm) {
		long long cub = 1ll * x * x * x;
		if (cub > a[id]) break;
		while (a[id] % cub == 0) a[id] /= cub;
	}
}

long long mul(long long x,long long y) {
	if (x > inf / y) return inf;
	return x * y;
}

long long needMul(long long x) {
	long long ret = 1;
	for (int v : prm) if (x % v == 0) {
		int cnt = 0;
		while (x % v == 0) cnt++, x /= v;
		for (int i = 1; i <= 3 - cnt; ++i) {
			ret = mul(ret, v);
		}
	}
	if (issqr(x)) ret = mul(ret, (long long)sqrt(x));
	else ret = mul(ret, mul(x, x));
	return ret;
}

int main() {
	ios_base::sync_with_stdio(false);
	sieve();
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i], calc(i);
		f[a[i]]++;
	}
	
	int ans = f.count(1);
	for (int i = 1; i <= n; ++i) if (a[i] != 1 && !was.count(a[i])) {
		long long tmp = needMul(a[i]);
		if (f.count(tmp)) {
			ans += max(f[a[i]], f[tmp]);
			was[tmp] = 1;
		} 
		else {
			ans += f[a[i]];
		}
		was[a[i]] = 1;
	}
	cout << ans << '\n';
}