#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
template<typename T> inline void chkmin(T &a, const T &b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T &a, const T &b) { a = a > b ? a : b; }

const int MAXN = 100005;
LL arr[MAXN];
int n, res;
unordered_map<LL, int> mp;

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", arr + i);
		LL x = arr[i], y = 1, z = 1, s;
		for (int j = 2; (LL)j * j * j <= x; j++) if (x % j == 0) {
			int c = 0;
			while (x % j == 0) x /= j, ++c;
			c %= 3;
			for (int a = 0; a < c; a++) y *= j;
			c = (3 - c) % 3;
			for (int a = 0; a < c; a++) {
				z *= j;
				if (z > 1e11) { ++res; goto finish; }
			}
		}
		s = round(sqrt(x));
		y *= x;
		if (s * s == x) { if (1e11 / s < z) { ++res; goto finish; } z *= s; }
		else if (1e11 / x / x < z) { ++res; goto finish; }
		else z *= x * x;
		if (y == z && mp[z]) continue;
		if (mp[y] >= mp[z]) ++res;
		finish: ++mp[y];
	}
	printf("%d\n", res);
	return 0;
}