There are multiple test cases. Each case consists a string in one line, indicating several identification number periods, and every two of them is separated by a space.
The length of the string in each line will not exceed. And in one line only containing the single character '#' terminates the input and this test case is not to be processed.
It's guaranteed that the string can only be made up by number digits '0'-'9' and spaces, and the sum of the length of the string of all test cases will not exceed 2×.
For each test case output one integer in one line, indicating the number of times when a Palindrome Date appears.
Because the number may be very large, just output the number mod.
130402202002021234 320124202332021862 110110116711302020 020208196711301866 022002202002025678 220202202002022021 120202202002022020 #
For the first sample, Little Gyro can find 4 Palindrome Dates in total. All of them are "20200202", but composed by different indexes. All the composition is shown as the following index boxes:
· [6,8,9,10,11,12,13,14]
· [7,8,9,10,11,12,13,14]
· [6,8,9,10,11,12,13,16]
· [7,8,9,10,11,12,13,16]
For the second sample, Little Gyro cannot find any Palindrome Dates as well.
For the third sample, Little Gyro can find 1 Palindrome Dates "20200202", composed by the last four digits in the first number period and the first four digits in the second number period. Although there also contains a Palindrome Date "11011011", it is not a valid date in the given interval.