10643: HDU2609 - How many
[Creator : ]
Description
Give you $n\ ( n < 10,000)$ necklaces ,the length of necklace will not large than $100$, tell me
How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces are some).
For example 0110 express a necklace, you can rotate it. 0110 -> 1100 -> 1001 -> 0011->0110.Input
The input contains multiple test cases.
Each test case include: first one integers $n\ (2\leq n\leq 10,000)$
Next $n$ lines follow. Each line has a equal length character string. (string only include '0','1').
Each test case include: first one integers $n\ (2\leq n\leq 10,000)$
Next $n$ lines follow. Each line has a equal length character string. (string only include '0','1').
Output
For each test case output a integer , how many different necklaces.
Sample 1 Input
4
0110
1100
1001
0011
4
1010
0101
1000
0001
Sample 1 Output
1
2