Moca's birthday is coming up, and her friend Ran is going to the Yamabuki bakery to order a birthday cake for her.
Yamabuki bakery provides

kinds of cake. Since Ran knows that Moca is the Yamabuki Bakery's

-st fan and can eat a lot of food, she intends to order two cakes and put them together into a big cake. The cake made by Yamabuki bakery can be formed by a string consisting of lowercase Latin letters, which describes the toppings on the cake, such as strawberries and chocolate. Putting two cakes together is the concatenation of two corresponding strings. For example, the result of putting cake

and cake

together is a big cake

.
To make it easier to share the cake, Ran will choose two cakes and put them together into a big cake which can be divided in half into two identical pieces. For example, cake

will be divided in half into two cakes

, but cake

will be divided in half into two different cakes

and

. Notice that Ran can not reverse the cake, which means that cake

will be divided into two different cakes

and

.
Can you help Ran figure out how many different pairs of cakes meet the above condition?