/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static int n = (int)1e6;
 
	public static int[] smallestPrimeFact = new int[n + 1];
	
	public static HashMap<Integer, Integer> function(int vl){
		HashMap<Integer, Integer> map = new HashMap<>();
		
		while(vl != 1){
			int d = smallestPrimeFact[vl];
			map.put(d, map.getOrDefault(d,0) + 1);
			vl /= d;
		}
		return map;
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		int N = 5;
		int[] arr = {1, 36, 9, 4, 6};
		
		Long count = 0L;
		
		for(int i = 2; i <= n; i++){
			smallestPrimeFact[i] = i;
		}
 
		for(int i = 2; i <= Math.sqrt(n); i++){
			if(smallestPrimeFact[i] == i){
				for(int j = i*i; j <= n; j += i){
					if(smallestPrimeFact[j] == j){
						smallestPrimeFact[j] = i; 
					}
				}
			}
		}
		
		HashMap<Long, Long> map = new HashMap<>();
		
		for(int i = 0; i < N; i++){
			HashMap<Integer, Integer> k = function(arr[i]);
			
			long g = 1;
			
			for(Map.Entry<Integer, Integer> en : k.entrySet()){
				int key = en.getKey();
				int freq = en.getValue();
				
				if(freq % 2 != 0){
					g *= key;
				}
			}
			
			count += map.getOrDefault(g, 0L);
			map.put(g, map.getOrDefault(g, 0L) + 1);
		}
		System.out.println(count);
	}
}