Suffi
InterviewTime limit0.5sMemory limit1024 MB
Count the suffixes that appear in an odd number of the N strings, since repeated XOR keeps only elements with odd multiplicity.
Statement
Bihaengssi is weak at strings and keeps studying string algorithms: LCS, KMP, Rabin-Karp, Aho-Corasick...
Bihaengssi's head exploded while staring at suffix arrays, so to cool off, they decide to organize the suffixes of the given strings. Plain sorting is dull, so they XOR the suffix sets instead.
For a string , the suffix set is the set whose elements are all suffixes of . The XOR of two sets and is defined as follows.
On behalf of Bihaengssi, write a program that counts the elements of the set obtained by XORing the suffix sets of the given strings in order: .
Input
The first line contains an integer .
The following lines each contain one string made of lowercase English letters only.
Output
Print the number of elements in .
The empty set has 0 elements.