#include <bits/stdc++.h>
using namespace std;
long long n,s[100005],s1[100005],maxn=2e3+50,ans;
map<long long,long long> dem,used;
int main() {
	scanf("%lld",&n);
	for(long long i=0;i<n;i++){
		scanf("%lld",&s[i]);
		long long x=s[i];
		s[i]=s1[i]=1;
		for(long long j=2;j<=maxn;j++){
			if(x%j==0){
				long long cnt=0;
				while(x%j==0){
					x/=j;
					cnt++;
				}
				if(cnt%3==1){
					s[i]*=j;
					s1[i]*=j*j;
				}else if(cnt%3==2){
					s[i]*=j*j;
					s1[i]*=j;
				}
			}
		}
		if(x!=1){
			long long y=sqrt(x);
			s[i]*=x;
			if(y*y==x) s1[i]*=y;
			else s1[i]*=x*x;
		}
		dem[s[i]]++;
	}
	for(long long i=0;i<n;i++){
		if(!used[s[i]]){
			used[s[i]]=used[s1[i]]=1;
			if(s[i]==1) ans++;
			else ans+=max(dem[s[i]],dem[s1[i]]);
		}
	}
	printf("%lld",ans);
	return 0;
}
