/**
 *    author:  tourist
 *    created: 24.01.2020 23:44:36       
**/
#include <bits/stdc++.h>

using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  const int MAX = 10000;
  vector<int> pr(MAX, 1);
  pr[0] = pr[1] = 0;
  vector<int> primes;
  for (int i = 2; i < MAX; i++) {
    if (pr[i]) {
      primes.push_back(i);
    }
    for (int j = i + i; j < MAX; j += i) {
      pr[j] = 0;
    }
  }
  const long long inf = (long long) 1e12;
  int n;
  cin >> n;
  vector<long long> d(n);
  vector<long long> u(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    u[i] = 1;
    long long tmp = d[i];
    d[i] = 1;
    for (int it = 0; it < (int) primes.size(); it++) {
      int p = primes[it];
      if (p * p * 1LL * p > tmp) {
        break;
      }
      if (tmp % p == 0) {
        int cnt = 0;
        while (tmp % p == 0) {
          tmp /= p;
          ++cnt;
        }
        cnt %= 3;
        for (int j = 0; j < cnt; j++) {
          d[i] *= p;
        }
        for (int j = 0; j < (3 - cnt) % 3; j++) {
          u[i] = min(inf, u[i] * p);
        }
      }
    }
    if (tmp > 1) {
      d[i] *= tmp;
      long long S = (long long) sqrt(double(tmp));
      if (S * S == tmp) {
        u[i] = min(inf, u[i] * S);
      } else {
        for (int rep = 0; rep < 2; rep++) {
          if (u[i] > inf / tmp) {
            u[i] = inf;
          } else {
            u[i] *= tmp;
          }
        }
      }
    }
    debug(i, d[i], u[i]);
  }
  int ones = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] == 1) {
      ones += 1;
    }
  }
  int ans = min(1, ones);
  map<long long, long long> ud;
  map<long long, int> mp;
  for (int i = 0; i < n; i++) {
    if (d[i] != 1) {
      ud[d[i]] = u[i];
      mp[d[i]] += 1;
    }
  }
  while (!mp.empty()) {
    auto it = mp.begin();
    long long y = ud[it->first];
    auto iy = mp.find(y);
    if (iy == mp.end()) {
      ans += it->second;
      mp.erase(it);
    } else {
      ans += max(it->second, iy->second);
      mp.erase(it);
      mp.erase(mp.find(y));
    }
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 14336