#Lutece0591. Windy's S(II)
Windy's S(II)
Migrated from Lutece 591 Windy's S(II)
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given a string with length .
......
$S(N-1) = A_{N-1}, A_0, A_1, A_2, A_3 \cdots A_{N-2}$
Windy want to know how many in that make euqal to .
Can you find it for Windy?
Input
The first line of input is the number of test case.
For each test case, there is only one line contains a string .
String only contains lowercase letter (a
--z
).
Output
For each test case output the answer on a single line.
Samples
3
aaa
abab
aba
3
2
1
Resources
Sichuan University Programming Contest