#include <bits/stdc++.h>
using namespace std;
#define ll int
#define dbg(x) cout << #x << " : " << x << endl
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define inf 1000000000000000000
priority_queue<ll, vector<ll>, greater<int>> qp;
priority_queue<ll> qr;
#define N 20000010
#define mod 1000000007
#define cnt_ones __builtin_popcount
bool isPrime[N + 1];
vector<int> primes;
void sieve()
{
for (int i = 0; i <= N; ++i)
{
isPrime[i] = true;
}
isPrime[0] = false;
isPrime[1] = false;
for (int i = 2; i * i <= N; ++i)
{
if (isPrime[i] == true)
{
// Mark all the multiples of i as composite numbers
for (int j = i * i; j <= N; j += i)
isPrime[j] = false;
}
}
}
bool aka(int source)
{
int tmp = (int)sqrt(source);
if (tmp * tmp == source and isPrime[tmp])
return true;
return false;
}
int main()
{
sieve();
for (int i = 1; i <= N; i++)
if (isPrime[i])
primes.push_back(i);
// cout<<primes.size();
int res = 0;
int tc;
cin >> tc;
while (tc--)
{
int n;
cin >> n;
int ans = 1;
for (auto p : primes)
{
if (p * p * p > n)
break;
int count = 1;
while (n % p == 0)
{
n = n / p;
count += 1;
}
ans = ans * count;
}
// cout<<"Con lai: "<<n<<'\n';
if (isPrime[n])
ans = ans * 2;
else if (aka(n))
ans = ans * 3;
else if (n != 1)
ans = ans * 4;
// cout<<"n: "<<n<<" and "<<"ans: "<<ans<<'\n';
if ( (ans == 4 && n!=1) || ans==3)
{
// cout << n << '\n';
res++;
}
}
cout << res;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgaW50CiNkZWZpbmUgZGJnKHgpIGNvdXQgPDwgI3ggPDwgIiA6ICIgPDwgeCA8PCBlbmRsCiNkZWZpbmUgcmVwKGksIGEsIGIpIGZvciAoaW50IGkgPSAoYSk7IGkgPD0gKGIpOyBpKyspCiNkZWZpbmUgaW5mIDEwMDAwMDAwMDAwMDAwMDAwMDAKcHJpb3JpdHlfcXVldWU8bGwsIHZlY3RvcjxsbD4sIGdyZWF0ZXI8aW50Pj4gcXA7CnByaW9yaXR5X3F1ZXVlPGxsPiBxcjsKI2RlZmluZSBOIDIwMDAwMDEwCiNkZWZpbmUgbW9kIDEwMDAwMDAwMDcKI2RlZmluZSBjbnRfb25lcyBfX2J1aWx0aW5fcG9wY291bnQKYm9vbCBpc1ByaW1lW04gKyAxXTsKdmVjdG9yPGludD4gcHJpbWVzOwp2b2lkIHNpZXZlKCkKewogICAgZm9yIChpbnQgaSA9IDA7IGkgPD0gTjsgKytpKQogICAgewogICAgICAgIGlzUHJpbWVbaV0gPSB0cnVlOwogICAgfQogICAgaXNQcmltZVswXSA9IGZhbHNlOwogICAgaXNQcmltZVsxXSA9IGZhbHNlOwogICAgZm9yIChpbnQgaSA9IDI7IGkgKiBpIDw9IE47ICsraSkKICAgIHsKICAgICAgICBpZiAoaXNQcmltZVtpXSA9PSB0cnVlKQogICAgICAgIHsKICAgICAgICAgICAgLy8gTWFyayBhbGwgdGhlIG11bHRpcGxlcyBvZiBpIGFzIGNvbXBvc2l0ZSBudW1iZXJzCiAgICAgICAgICAgIGZvciAoaW50IGogPSBpICogaTsgaiA8PSBOOyBqICs9IGkpCiAgICAgICAgICAgICAgICBpc1ByaW1lW2pdID0gZmFsc2U7CiAgICAgICAgfQogICAgfQp9CmJvb2wgYWthKGludCBzb3VyY2UpCnsKICAgIGludCB0bXAgPSAoaW50KXNxcnQoc291cmNlKTsKICAgIGlmICh0bXAgKiB0bXAgPT0gc291cmNlIGFuZCBpc1ByaW1lW3RtcF0pCiAgICAgICAgcmV0dXJuIHRydWU7CiAgICByZXR1cm4gZmFsc2U7Cn0KaW50IG1haW4oKQp7CiAgICBzaWV2ZSgpOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gTjsgaSsrKQogICAgICAgIGlmIChpc1ByaW1lW2ldKQogICAgICAgICAgICBwcmltZXMucHVzaF9iYWNrKGkpOwogICAgLy8gY291dDw8cHJpbWVzLnNpemUoKTsKICAgIGludCByZXMgPSAwOwogICAgaW50IHRjOwogICAgY2luID4+IHRjOwogICAgd2hpbGUgKHRjLS0pCiAgICB7CiAgICAgICAgaW50IG47CiAgICAgICAgY2luID4+IG47CiAgICAgICAgaW50IGFucyA9IDE7CiAgICAgICAgZm9yIChhdXRvIHAgOiBwcmltZXMpCiAgICAgICAgewogICAgICAgICAgICBpZiAocCAqIHAgKiBwID4gbikKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBpbnQgY291bnQgPSAxOwogICAgICAgICAgICB3aGlsZSAobiAlIHAgPT0gMCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgbiA9IG4gLyBwOwogICAgICAgICAgICAgICAgY291bnQgKz0gMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBhbnMgPSBhbnMgKiBjb3VudDsKICAgICAgICB9CiAgICAgICAgLy8gY291dDw8IkNvbiBsYWk6ICI8PG48PCdcbic7CiAgICAgICAgaWYgKGlzUHJpbWVbbl0pCiAgICAgICAgICAgIGFucyA9IGFucyAqIDI7CiAgICAgICAgZWxzZSBpZiAoYWthKG4pKQogICAgICAgICAgICBhbnMgPSBhbnMgKiAzOwogICAgICAgIGVsc2UgaWYgKG4gIT0gMSkKICAgICAgICAgICAgYW5zID0gYW5zICogNDsKICAgICAgICAvLyBjb3V0PDwibjogIjw8bjw8IiBhbmQgIjw8ImFuczogIjw8YW5zPDwnXG4nOwogICAgICAgIGlmICggKGFucyA9PSA0ICYmIG4hPTEpIHx8IGFucz09MykKICAgICAgICB7CiAgICAgICAgICAgIC8vIGNvdXQgPDwgbiA8PCAnXG4nOwogICAgICAgICAgICByZXMrKzsKICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8IHJlczsKICAgIHJldHVybiAwOwp9