#include <bits/stdc++.h>


using namespace std;


#ifdef zxc

#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-10;
const ll MOD = 1e9 + 7;
const ld PI = 3.141592653589793;
const int maxn = 200001;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

bool is_prime(int n) {
    for (int i = 2; i * i <= n; ++i) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}

ll s[maxn];

signed main() {
#ifdef zxc
    mt19937 mt(228);
    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif
    fast_io();
    cout.precision(1);
    cout << fixed;
    auto start = chrono::steady_clock::now();
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> s[i];
    }
    vector<int> primes;
    for (int i = 2; i <= 2200; ++i) {
        if (is_prime(i)) {
            primes.push_back(i);
        }
    }
//    debug(primes.size());
    map<ll, ll> revs;
    map<ll, int> cnt;
    const ll MX = 1e10;
//    debug(MX);
    for (int i = 1; i <= n; ++i) {
        ll was = s[i];
        ll cur_hsh = 1;
        ll rev = 1;
        for (int el:primes) {
            if (s[i] % el == 0) {
                int exp = 0;
                while (s[i] % el == 0) {
                    ++exp;
                    s[i] /= el;
                }
                if (exp % 3 == 1) {
                    cur_hsh *= el;
                    rev *= el * el;
                    if (rev > MX) {
                        rev = 0;
                    }
                } else if (exp % 3 == 2) {
                    cur_hsh *= el;
                    cur_hsh *= el;
                    rev *= el;
                    if (rev > MX) {
                        rev = 0;
                    }
                }
            }
        }
        if (s[i] != 1) {
            int z = sqrtl(s[i]) + 0.1;
            cur_hsh *= s[i];
            if (1ll * z * z == s[i]) {
                rev *= z;

                if (rev > MX) {
                    rev = 0;
                }
            } else {
                __int128 inte = rev * s[i];
                inte *= s[i];
                if (inte > MX) {
                    rev = 0;
                } else {
                    rev = inte;
                }
            }
        }
        debug(was, cur_hsh, rev);
        cnt[cur_hsh]++;
        revs[cur_hsh] = rev;
    }
    set<ll> used;
    int ans = 0;
    used.insert(1);
    if (cnt.count(1)) {
        ++ans;
    }
    for (auto it: cnt) {
        if (used.count(it.first)) {
            continue;
        }
        used.insert(it.first);

        ll r = revs[it.first];
        used.insert(r);
        auto x = cnt.find(r);
        int cnt_rev = 0;
        if (x != cnt.end()) {
            cnt_rev = x->second;
        }
        ans += max(it.second, cnt_rev);
    }
    cout << ans;
    auto end = chrono::steady_clock::now();
    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}



Measured memory_bytes: 19200