#include <iostream>
#include <vector>
#include <unordered_map>
#define int long long
using namespace std;
vector<int> pri,vis(50,0);
unordered_map<int,int> dp;
int n,ans;
void init(int n){
for(int i = 2;i <= n; i++)
if(!vis[i]){
pri.push_back(i);
for(int j = i;j <= n; j += i)
vis[j] = 1;
}
}
int solve(int num){
int res = 0;
for(auto &x : pri){
if(num > x) break;
while(num % x == 0) res ^= (1 << x),num /= x;
}
return res;
}
main(){
init(30);
cin >> n;
dp[0] = 1;
for(int i = 1,x,res = 0;i <= n; i++){
cin >> x;
res ^= solve(x);
ans += dp[res],dp[res]++;
}
cout << ans;
}