You are given a string of length . Each character of is either an uppercase English letter or a period ..
Construct a string by replacing every period in with an uppercase English letter. Characters that are already uppercase letters cannot be changed.
For every integer (), the prefix must be a palindrome. A palindrome reads the same from left to right and from right to left.
Find the number of distinct strings satisfying the condition.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the number of distinct strings satisfying the condition on one line.
Constraints
- .
- .
- The sum of over all test cases does not exceed .
- .
- is an uppercase English letter or a period
.().
Subtasks
Samples
입력
6
1
.
4
....
5
A.A..
3
A.B
6
Z..Z..
5
..A.B
출력
26
26
1
0
1
0