Without reciprocity
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a sequence of n integers (A_1, A_2, ..., A_n), your task is to find the maximum length of a subsequence where no two numbers are considered mutually close. Two numbers are defined as mutually close if one can be transformed into the other by a cyclic shift of all the digits in their decimal representation. For instance, the numbers 7353 and 3537 are mutually close, whereas 730 and 73 are not, since you cannot obtain one from the other through a cyclic shift of all digits.
Input
The first line contains the integer n, and the second line contains the integers (A_1, A_2, ..., A_n).
Output
Output a single line with the solution to the problem.
Examples
Input #1
Answer #1
Submissions 157
Acceptance rate 37%