#include <cstdio>
#include <cmath>
#include <map>
#include <vector>

#define PB push_back

using namespace std;

typedef long long ll;

const int N = 1e5 + 500;

int prost[N], n;
ll A[N];
vector < ll > pr;
map < ll, int > kol;

void precompute(){
	for(int i = 2;i < N;i++){
		if(prost[i])
			continue;
		pr.PB(i);
		for(int j = 2 * i;j < N;j += i)
			prost[j] = 1;
	}
}

ll skrati(ll x){
	for(int i = 0;pr[i] * pr[i] * pr[i] <= x;i++){
		while(!(x % (pr[i] * pr[i] * pr[i])))
			x /= pr[i] * pr[i] * pr[i];
	}
	return x;
}

ll obrni(ll x){
	ll ret = 1;
	for(int i = 0;pr[i] * pr[i] * pr[i] <= x;i++){
		if(x % pr[i]) continue;
		ret *= pr[i]; x /= pr[i];
		if(x % pr[i])
			ret *= pr[i];
		else
			x /= pr[i];
	}
	ll kor = (ll)sqrtl(x);
	if(kor * kor == x)
		ret *= kor;
	else
		ret *= x * x;
	return ret;
}

int main(){
	precompute();
	scanf("%d", &n);
	for(int i = 0;i < n;i++){
		ll x; scanf("%lld", &x);
		x = skrati(x);
		A[i] = x;
		kol[x]++;
	}
	int sol = 0, jedn = 0;
	for(int i = 0;i < n;i++){
		if(A[i] == 1){
			jedn = 1; continue;
		}
		ll drugi = obrni(A[i]);
		if(kol[A[i]] > kol[drugi] || (kol[A[i]] == kol[drugi] && A[i] > drugi))
			sol++;
	}
	printf("%d\n", sol + jedn);
}



