#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
 
using namespace std;
typedef long long ll;
typedef pair<int,int> pi; 

const int N=100005;
vector<int>prime;
inline bool check(int x){for(int p=2;p*p<=x;p++)if(x%p==0)return false;return true;}
inline ll dcube(ll x){for(int p:prime){ll u=(ll)p*p*p;if(u>x)break;while(x%u==0)x/=u;}return x;}
inline ll squ(ll x){ll r=sqrt(x)-1;while(r*r<x)r++;return r;}
inline ll gop(ll x){
	ll ret=1;int now=0;
	for(int p:prime){
		ll u=(ll)p*p*p;
		if(u>x)break;
		for(now=0;x%p==0;now--)x/=p;
		for(now=(now%3+3)%3;now;now--)ret*=p;
	}
	ll s=squ(x);
	if(s*s==x)x/=s*s,ret*=s;
	return ret*x*x;
}

ll b[N],a[N];
map<ll,pi>cnum;
int n,ans;

int main(){
	for(int i=2;i<=2333;i++)if(check(i))prime.pb(i);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
		a[i]=dcube(a[i]),b[i]=gop(a[i]);
		cnum[a[i]].fi++,cnum[b[i]].se++;
	}
	if(cnum.find(1)!=cnum.end())cnum[1]={2,2};
	for(auto v:cnum)ans+=max(v.se.fi,v.se.se);
	printf("%d\n",ans>>1);
	return 0;
}