#include <bits/stdc++.h>
using namespace std;
 
map<long long, long long> cnt;
long long arr[100050];
bool isPrime[3060];
vector<long long> prime;
long long Slove(long long n)
{
    for(vector<long long>::size_type i = 0; i < prime.size(); ++i)
    {
        while(n % prime[i] == 0)
            n /= prime[i];
    }
    return n;
}
int main()
{
    memset(isPrime, true, sizeof(isPrime));
    for(long long i = 2; i <= 3000; ++i)
    {
        if(!isPrime[i])
            continue;
        prime.push_back(i * i * i);
        for(long long j = i + i; j <= 3000; j += i)
            isPrime[j] = false;
    }
    long long n;
    scanf("%lld", &n);
    for(long long i = 1; i <= n; ++i)
        scanf("%lld", &arr[i]);
    for(long long i = 1; i <= n; ++i)
        ++cnt[ Slove(arr[i]) ];
    long long ans;
    if(cnt.find(1) != cnt.end())
        ans = 1;
    else
        ans = 0;
    for(auto it = cnt.begin(); it != cnt.end(); ++it)
    {
        if(it->first == 1)
            continue;
        long long a = it->first;
        long long b = Slove(a * a);
        ans += max(cnt[a], cnt[b]);
        cnt[a] = 0;
        cnt[b] = 0;
    }
    printf("%lld\n", ans);
    return 0;
}