#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<map>
#include<cmath>
#define fi first
#define se second
#define ll long long
using namespace std;
ll n,s,ans,v[3000],pri[3000],tot;
map<ll,ll> Map,D,vis;
int main()
{
///dsfafdafdasfdasf
	scanf("%lld",&n);
	for(ll i=2;i<=2500;i++)
	{
		if(!v[i]) pri[++tot]=i;
		for(ll j=i*2;j<=2500;j+=i) v[j]=1;
	}
	for(ll i=1;i<=n;i++)
	{
		scanf("%lld",&s);ll nw=1,de=1;
		for(ll j=1,p=0;j<=tot;j++,p=0)
		{
			while(s%pri[j]==0) s/=pri[j],p++;p%=3;
			if(p==1) nw*=pri[j],de*=pri[j]*pri[j];
			if(p==2) nw*=pri[j]*pri[j],de*=pri[j];
		}
		if(((int)sqrt(s))*((int)sqrt(s))==s) de*=sqrt(s);
		else de*=s*s;nw*=s;
		D[de]=nw,D[nw]=de,Map[nw]++;
	}
	for(auto x:Map) if(!vis[x.fi]&&x.fi!=1)
					{
						ans+=max(x.se,Map[D[x.fi]]);
						vis[x.fi]=vis[D[x.fi]]=1;
					}
	cout<<ans+(Map[1]>0)<<endl;return 0;
}
