

Time Limit: 5 sec / Memory Limit: 256 MB
配点 : 点
問題文
高橋君は誕生日にお母さんから正の整数 をもらいました。ただし、要素の重複は許されます。 高橋君は、これらの個の整数のうちのいくつかを丸で囲みます。
高橋君は立方数が嫌いなので、の両方が丸で囲まれているなら、その積は立方数とならないようにしたいです。 例えば、のとき、とを同時に丸で囲むことはできません。また、とを同時に丸で囲むこともできません。
高橋君が丸で囲むことができる整数の個数の最大値を求めてください。
制約
- 入力はすべて整数である。
入力
入力は以下の形式で標準入力から与えられる。
:
出力
高橋君が丸で囲むことができる整数の個数の最大値を表す整数を出力せよ。
入力例 1Copy
8 1 2 3 4 5 6 7 8
出力例 1Copy
6
を丸で囲むことができます。
入力例 2Copy
6 2 4 8 16 32 64
出力例 2Copy
3
入力例 3Copy
10 1 10 100 1000000007 10000000000 1000000009 999999999 999 999 999
出力例 3Copy
9
Score : points
Problem Statement
Snuke got positive integers from his mother, as a birthday present. There may be duplicate elements.
He will circle some of these integers. Since he dislikes cubic numbers, he wants to ensure that if both and are circled, the product is not cubic. For example, when , it is not possible to circle both and at the same time. It is not possible to circle both and at the same time, either.
Find the maximum number of integers that Snuke can circle.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
:
Output
Print the maximum number of integers that Snuke can circle.
Sample Input 1Copy
8 1 2 3 4 5 6 7 8
Sample Output 1Copy
6
Snuke can circle .
Sample Input 2Copy
6 2 4 8 16 32 64
Sample Output 2Copy
3
Sample Input 3Copy
10 1 10 100 1000000007 10000000000 1000000009 999999999 999 999 999
Sample Output 3Copy
9