@Anticube@
@Problem Statement@
Snuke got positive integers s1,…,sN from his mother, as a birthday present. There may be duplicate elements.
He will circle some of these N integers. Since he dislikes cubic numbers, he wants to ensure that if both si and sj(i≠j) are circled, the product si*sj is not cubic. For example, when s1=1,s2=1,s3=2,s4=4, it is not possible to circle both s1 and s2 at the same time. It is not possible to circle both s3 and s4 at the same time, either.
Find the maximum number of integers that Snuke can circle.
Constraints
1≦N≦10^5
1≦si≦10^10
All input values are integers.
Input
The input is given from Standard Input in the following format:
N
s1
:
sN
Output
Print the maximum number of integers that Snuke can circle.
Sample Input 1
8
1
2
3
4
5
6
7
8
Sample Output 1
6
Snuke can circle 1,2,3,5,6,7.
Sample Input 2
6
2
4
8
16
32
64
Sample Output 2
3
Sample Input 3
10
1
10
100
1000000007
10000000000
1000000009
999999999
999
999
999
Sample Output 3
9
@Translation@
Snuke 收到了一份特殊的生日礼物:N 个正整数!
Snuke 认为两个数是“不相配”的,当且仅当这两个数的乘积为立方数。
现在 Snuke 想要从 N 个数中选出尽量多的数,使得这些数两两“相配”。
@Solution@
首先,可以想到的第一个操作肯定是把每一个数的立方因子去掉。
然后从唯一分解式考虑:令 x = p 1 a 1 ∗ p 2 a 2 ∗ . . . ∗ p k a k x = p_1^{a_1}*p_2^{a_2}*...*p_k^{a_k} x=p1a1∗p2a2∗...∗pkak。
去掉立方因子得到: x ′ = p 1 a 1 m o d    3 ∗ p 2 a 2 m o d    3 ∗ . . . ∗