#include<cstdio>
#include<map>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N=100005;

int n,ans; LL a[N];
map<LL,int>cnt;

inline LL Opp(LL x) {
	LL tmp=x, s=8, ret=1;
	for(int j=2;s<=tmp;j++,s=1ll*j*j*j)
		if(tmp%j==0) {
			tmp/=j;
			if(tmp%j==0)
				ret*=j,tmp/=j;
			else ret*=j*j;
			if(ret>1e10) return -1;
		}
	s=sqrt(tmp);
	if(s*s==tmp) return ret*s;
	if((ret*=tmp)>1e10) return -1;
	return ret*tmp;
}
int main() {
	scanf("%d",&n);
	for(int i=1;i<=n;i++) {
		scanf("%lld",&a[i]);
		LL tmp=a[i], s=8; a[i]=1;
		for(int j=2;s<=tmp;j++,s=1ll*j*j*j) {
			while(tmp%s==0) tmp/=s;
			while(tmp%j==0) tmp/=j,a[i]*=j;
		}
		if(tmp>1) a[i]*=tmp;
		cnt[a[i]]++;
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++) {
		if(a[i]==1) continue;
		if(a[i]!=a[i-1]) {
			LL op=Opp(a[i]);
			ans+=max(cnt[a[i]],cnt[op]);
			cnt[a[i]]=cnt[op]=0;
		}
	}
	printf("%d\n",ans+(a[1]==1));
	return 0;
}