First non-palindrome#205

First non-palindrome

2 seconds
64 megabytes
Very easy

Find the longest substring of the given string that is not a palindrome.

Input

A string of characters is given. The number of characters in the string does not exceed 10^5.

Output

Output the length of the longest non-palindromic substring. If no such substring exists, output -1.

Examples

Example 1

Loading
Loading