#include<cstdio>
#include<iostream>
#include<cmath>
#include<map>
#define ll long long
using namespace std;
ll a[101010],x[101010],y[101010];
ll n,ans;
map<ll,ll> mp,br;
int main()
{
	scanf("%lld",&n);
	for (ll i=1;i<=n;++i)
	{
		scanf("%lld",&a[i]);
		x[i]=1; y[i]=1;
		for (ll j=2;j*j*j<=a[i];++j)
		if (a[i]%j==0)
		{
			int k=0;
			while (a[i]%j==0) a[i]/=j,++k;
			if (k%3==1) x[i]*=j,y[i]*=j*j;
			if (k%3==2) x[i]*=j*j,y[i]*=j;
		}
		x[i]*=a[i];
		if ((ll)sqrt(a[i])*(ll)sqrt(a[i])==a[i]) y[i]*=sqrt(a[i]);
		else y[i]*=a[i]*a[i];
		++mp[x[i]];
	}
	for (int i=1;i<=n;++i)
		if (br[x[i]]==0)
		{
			br[x[i]]=1;
			br[y[i]]=1;
			if (x[i]==1) ++ans;
			else ans+=max(mp[x[i]],mp[y[i]]);
		}
	printf("%lld\n",ans);
	return 0;
}