#include <bits/stdc++.h>

using namespace std;

typedef long long int64;

vector< int > prime;

void init()
{
  bool isprime[2201] = {};
  for(int64 i = 2; i < 2201; i++) {
    if(!isprime[i]) {
      prime.push_back(i);
      for(int64 j = i + i; j < 2201; j += i) isprime[j] = true;
    }
  }
}

int64 getNorm(int64 val)
{
  for(int k : prime) {
    int64 div = 1LL * k * k * k;
    while(val % div == 0) val /= div;
  }
  return (val);
}

int main()
{
  init();

  int N, ret = 0;
  map< int64, int > Norm;

  scanf("%d", &N);
  for(int i = 0; i < N; i++) {
    int64 S;
    scanf("%lld", &S);
    int64 norm = getNorm(S);
    if(norm == 1) ret = true;
    else ++Norm[norm];
  }

  for(auto& it : Norm) {
    int64 norm = getNorm(it.first * it.first);
    ret += max(it.second, Norm[norm]);
    it.second = 0;
    Norm[norm] = 0;
  }

  printf("%d\n", ret);
}
