Sanggeun received a secret message from Changyeong. The message uses only uppercase letters, and its length is at least 2.
Decoding the message takes the following operation. Delete a few characters from the front of the string S, or delete a few characters from the back of S, and take what remains as a piece. Then glue that piece onto the front or the back of S. The number of deleted characters is at least 1 and smaller than the length of S, so the piece is never empty and never equal to all of S.
For example, there are 8 ways to apply the operation to the string ABC.
You are given the string Sanggeun finished decoding. Write a program that counts how many ways there are to build it. The operation may be applied several times. Two ways count as different when the sequence of operations differs, even if they produce the same string. For example, there are 4 ways to build AAA from AA.
The first line contains the decoded string. It consists of uppercase letters only, and its length is at least 2 and at most 100.
Print the number of ways to build the given string. The starting message must have length at least 2. The count can grow very large, so print it modulo 2014. If the string cannot be built at all, print 0.
There are 8 ways to build ABABA.