#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll a[100010],b[100010];
int n,ans;
map<ll,int>mp;


ll pw(ll x)
{
	return x*x;
}

int main()
{
	scanf("%d",&n);
	for(int i=1; i<=n; i++)
	{
		ll x;
		scanf("%lld",&x);
		for(ll j=2; j*j*j<=x; j++)
			while(x%(j*j*j)==0)
				x/=j*j*j;
		mp[x]++;
		a[i]=x;
		ll y=1;
		for(ll j=2; j*j*j<=x; j++)
			if(x%j==0)
			{
				y*=(x%(j*j)==0)?j:j*j;
				while(x%j==0)x/=j;
			}
		if(pw((ll)sqrt(x))==x)y*=(ll)sqrt(x);
		else y*=x*x;
		b[i]=y;
	}
	if(mp[1])
	{
		ans++;
		mp[1]=0;
	}
	for(int i=1; i<=n; i++)
	{
		ans+=max(mp[a[i]],mp[b[i]]);
		mp[a[i]]=mp[b[i]]=0;
	}
	printf("%d",ans);
	return 0;
}