You are given a non-empty string consisting of lowercase Latin letters. You are allowed to add characters to the beginning and the end of the string. Add the minimum number of characters to obtain a palindrome.
Recall that a palindrome is a string that reads the same forwards and backwards.
A single string consisting of lowercase Latin letters. The length of the string is from to 10^6 characters.
Print the minimum number of characters that must be added to the original string to obtain a palindrome.
Example 1