#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL read()
{
    char c=getchar();LL f=1,sum=0;
    while(c<'0' || c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0' && c<='9'){sum=sum*10+c-'0';c=getchar();}
    return sum*f;
}
map<LL,LL>iv,cnt;
LL a;LL n,vis[100005],p[100005],tot,ans,gg;
void shai()
{
	for(int i=2;i<=100000;i++)
    {
        if(!vis[i]) p[++tot]=i;
        for(int j=1;j<=tot&&i*p[j]<=100000;j++){vis[i*p[j]]=1;if(i%p[j]==0) break;}
    }
}
int main()
{
    shai();
    n=read();
	for(int i=1;i<=n;i++)
    {
        a=read();LL t=a,val=1,inv=1;
        for(int j=1;j<=tot&&1ll*p[j]*p[j]*p[j]<=a;j++) if(t%p[j]==0)
        {
            int mi=0;while(t%p[j]==0) t/=p[j],mi++;mi%=3;
            for(int i=1;i<=mi;i++) val*=1ll*p[j];for(int i=1;i<=(3-mi)%3;i++) inv*=1ll*p[j];
        }
        if(t>1){val*=t;LL sq=sqrt(t);if(sq*sq==t) inv*=sq;else inv*=t*t;}
        if(val==1) gg=1;else cnt[val]++,iv[inv]=val,iv[val]=inv;
    }
    for(map<LL,LL>::iterator it=cnt.begin();it!=cnt.end();++it)
    {
        if(cnt.find(iv[it->first])==cnt.end()) ans+=it->second;
        else ans+=max(it->second,cnt[iv[it->first]]),it->second=0,cnt[iv[it->first]]=0;
    }
    printf("%lld\n",ans+gg);
}