#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; template vector smallest_prime_factors(T n){ vector spf(n+1); for(int i=0;i<=n;i++) spf[i]=i; for(T i=2;i*i<=n;i++){ if(spf[i]==i){ for(T j=i*i;j<=n;j+=i){ if(spf[j]==j) spf[j]=i; } } } return spf; } template vector factolization(T x,vector &spf){ vector ret; while(x!=1) { ret.push_back(spf[x]); x/=spf[x]; } sort(ALL(ret)); return ret; } bitset<80000> B[200200]; int C[1000100]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); constexpr int MAX=1000100; auto spf=smallest_prime_factors(MAX); int n; cin>>n; vector A(n); rep(i,n) cin>>A[i]; int cnt=0; for(int i=2;i<=1000000;i++){ if(spf[i]==i){ C[i]=cnt; cnt++; } } ll ans=0; string a; rep(i,80000) a+='0'; string now=a; map M; rep(i,n){ auto result=factolization(A[i],spf); for(auto t:result){ if(now[C[t]]=='0') now[C[t]]='1'; else now[C[t]]='0'; } ans+=M[now]; if(now==a) ans++; M[now]++; } cout<