// Slower C++ solution:
#include <bits/stdc++.h>

#ifndef LOCAL

#pragma GCC optimize(3)

#define lld "%lld"

#else

#define lld "%I64d"

#endif

using namespace std;

typedef long long ll;

const int inf=0x3f3f3f3f;

const int maxn=1e5;

ll p[maxn];

bool vis[maxn];

map<ll, int>cnt;

int pCnt;

void init() {

    for (int i=2; i<maxn; i++) {

        if (!vis[i]) p[pCnt++]=i;

        for (int j=0; j<pCnt && p[j]*i<maxn; j++) {

            vis[i*p[j]]=1;

            if (i%p[j]==0) break;

        }

    }

}

ll da1[maxn], da2[maxn];

void deal(int id) {

    ll ans1=1, ans2=1;

    ll tmp=da1[id];

    for (int i=0; p[i]*p[i]*p[i]<=tmp; i++) {

        int tot=0;

        while (tmp%p[i]==0) {

            tot++;

            tmp /= p[i];

        }

        tot%=3;

        if (tot==1) {

            ans1*=p[i];

            ans2*=p[i]*p[i];

        } else if (tot==2) {

            ans1*=p[i]*p[i];

            ans2*=p[i];

        }

    }

    ll sqrTmp=sqrt(tmp);

    if (sqrTmp*sqrTmp==tmp) {

        ans1*=tmp;

        ans2*=sqrTmp;

    } else {

        ans1*=tmp;

        ans2*=tmp*tmp;

    }

    da1[id]=ans1; da2[id]=ans2;

    cnt[ans1]++;

}

int main() {

#ifdef LOCAL

    freopen("in.txt", "r", stdin);

    freopen("out.txt", "w", stdout);

#endif

    int n; 

    init();

    scanf("%d", &n);

    for (int i=0; i<n; i++) {

        scanf(lld, da1+i);

        deal(i);

    }

    int ans=0;

    if (cnt[1]) ans++, cnt[1]=0;

    for (int i=0; i<n; i++) {

        ans += max(cnt[da1[i]], cnt[da2[i]]);

        cnt[da1[i]]=cnt[da2[i]]=0;

    }

    printf("%d", ans);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.1402931738998188x):
#include <bits/stdc++.h>

using namespace std;



#define visit fuckitwholefamily

#define ll long long

#define MAXN 100005

#define Int int



int n,ans;ll s[MAXN];

map <ll,int> tot;

map <ll,bool> vis;



template <typename T> inline void read (T &t){t = 0;char c = getchar();int f = 1;while (c < '0' || c > '9'){if (c == '-') f = -f;c = getchar();}while (c >= '0' && c <= '9'){t = (t << 3) + (t << 1) + c - '0';c = getchar();} t *= f;}

template <typename T,typename ... Args> inline void read (T &t,Args&... args){read (t);read (args...);}

template <typename T> inline void write (T x){if (x < 0){x = -x;putchar ('-');}if (x > 9) write (x / 10);putchar (x % 10 + '0');}



int cnt,prime[3405],visit[3405];



void Euler (int up){

	for (Int i = 2;i <= up;++ i){

		if (!visit[i]) prime[++ cnt] = i;

		for (Int j = 1;j <= cnt && i * prime[j] <= up;++ j){

			visit[i * prime[j]] = 1;

			if (i % prime[j] == 0) break; 

		}

	}

}



signed main(){

	read (n);Euler (3400);

	for (Int i = 1;i <= n;++ i){

		read (s[i]);

		for (ll p = 2;p * p * p <= s[i];++ p) while (s[i] % (p * p * p) == 0) s[i] /= p * p * p; 

		if (s[i] != 1) tot[s[i]] ++;

		else ans = 1;

	}

	for (Int i = 1;i <= n;++ i) 

		if (vis[s[i]] || s[i] == 1) continue;

		else{

			ll now = s[i],nowto = 1;

			for (Int j = 1;1ll * prime[j] * prime[j] * prime[j] <= now;++ j){

				if (now % prime[j] == 0){

					nowto *= (now % (prime[j] * prime[j]) == 0 ? prime[j] : prime[j] * prime[j]);

					while (now % prime[j] == 0) now /= prime[j];

				}

			}

			ll w = sqrt (now);

			if (w * w == now) nowto *= w;

			else nowto *= now * now;

			vis[s[i]] = vis[nowto] = 1,ans += max (tot[s[i]],tot[nowto]);

		}

	write (ans),putchar ('\n');

	return 0;

}