#include<iostream>
#include<cstdio>
#include<cmath>
#include<map>
#define N (100000+1000)
using namespace std;

long long vis[N],prime[N],cnt,n,x,a[N],b[N];
map<long long,long long>Map;

void Init(int n)
{
	for (int i=2; i<=n; ++i)
	{
		if (!vis[i]) prime[++cnt]=i;
		for (int j=1; j<=cnt && prime[j]*i<=n; ++j)
		{
			vis[prime[j]*i]=true;
			if (i%prime[j]==0) break;
		}
	}
}

long long sqr(long long x){return  x*x;}

int main()
{
	Init(3000);
	scanf("%lld",&n);
	for (int i=1; i<=n; ++i)
	{
		scanf("%lld",&x);
		for (int j=1; j<=cnt; ++j)
			while (x%(prime[j]*prime[j]*prime[j])==0)
				x/=prime[j]*prime[j]*prime[j];
		Map[x]++; a[i]=x;
		long long y=1;
		for (int j=1; j<=cnt; ++j)
			if (x%prime[j]==0)
			{
				y*=x%(prime[j]*prime[j])==0?prime[j]:prime[j]*prime[j];
				while (x%prime[j]==0) x/=prime[j];
			}
		if (sqr((long long)sqrt(x))==x) y*=(long long)sqrt(x);
		else y*=x*x;
		b[i]=y;
	}
	long long ans=0;
	if (Map[1]) ans++; Map[1]=0;
	for (int i=1; i<=n; ++i)
	{
		ans+=max(Map[a[i]],Map[b[i]]);
		Map[a[i]]=Map[b[i]]=0;
	}
	printf("%lld",ans);
}