#!/bin/sh
read n
read -d "" s
r=","
x=0
for i in `echo "${s}" | sort -u`
do
	a=$(( i * i ))
	b=$(( a * i ))
	r="$r$b,"
done

for i in `echo "${s}" | sort`
do
	if [ `echo "${r}" | grep -c ,"$i",` -eq 0 ]
	then
		x=$(( x + 1 ))
	fi
done
if [ `echo "${r}" | grep -c ,1,` -ne 0 ]
then
	x=$(( x + 1 ))
fi
echo $(( x - 1 ))
