#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#define inf 20021225
#define ll long long
#define mxn 100100
using namespace std;

map<ll,int> s;
map<ll,bool> h;
bool isp[10100];
ll p[1310],cnt;
void get(int n)
{
	isp[1]=1;
    for(int i=2;i<=n;i++)
    {
        if(!isp[i])	p[++cnt]=i;
        for(int j=1;j<=cnt&&p[j]*i<=n;j++)
        {
            isp[p[j]*i]=1;
            if(i%p[j]==0)	break;
        }
    }
}
ll a[mxn],b[mxn]; int n;
int main()
{
	get(10000);// printf("%d\n",cnt);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
		ll q=a[i]; a[i]=b[i]=1ll;
		for(int j=1;j<=cnt;j++)
		{
			int qwq=0;
			if(q==1)	break;
			if(q%p[j]==0)
			{
				while(q%p[j]==0)
				{
					q/=p[j];
					qwq++;
				}
				qwq%=3;
				if(qwq==1)	b[i]*=(ll)p[j]*p[j],a[i]*=p[j];
				if(qwq==2)	b[i]*=p[j],a[i]*=(ll)p[j]*p[j];
			}
		}
		if(q!=1)
		{
			ll x=(ll)sqrt(q);
			if(x*x == q)	b[i]*=x,a[i]*=x*x;
			else	b[i]*=q*q,a[i]*=q;
		}
	}
	for(int i=1;i<=n;i++)	s[a[i]]++;
	int	ans=0;// printf("%d\n",ans);
	for(int i=1;i<=n;i++)
	{
		if(!h[a[i]])
		{
			h[a[i]]=h[b[i]]=1;
			if(a[i]==b[i])	ans++;
			else	ans+=max(s[a[i]],s[b[i]]);
		}
	}
	printf("%d\n",ans);
	return 0;
}