Find the position of the leftmost character that appears only once in a given string.

Input

A single line containing a string of characters.

Output

The position of the leftmost character in the string that appears only once. Positions are indexed from 0. The integer -1 must be written to the output in case none of the characters appears only once in the string.

Example

Input:

aabbcddd

Output:

4

Example

Input:

aabbcccddd

Output:

-1