#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second

const long long MAXN = 1e5 + 21, inf = 1e18 + 21, LG = 20;

int n;
long long ans;
long long a[MAXN];
map<long long, long long> mp;
set<long long> st;

inline long long anti(long long x) {
	for (long long i = 2; i <= 2500; i++){
		long long c = i * i * i;
		if(x < c) 
            return x;
		while(x % c == 0) 
            x /= c;
	}
	return x;
}

int main(void) {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for(int i = 1; i <= n; i++) 
        cin >> a[i];
	for(int i = 1; i <= n; i++) {
        a[i] = anti(a[i]);
        mp[a[i]]++;
    }
	
    for (auto y: mp) {
        if (y.ff == 1) {
            ans++;
            continue;
        }
        if (st.count(y.ff))
            continue;
        long long tmp = anti(y.ff * y.ff);
        ans += max(y.ss, mp[tmp]);
        st.insert(tmp);
    }

	cout << ans << '\n';
	return 0;
}

