Deletion#1959

Deletion

1 second
128 megabytes
Easy

Given a string . You must obtain the string sis from using the minimum number of deletions. A deletion is defined as removing a sequence of consecutive characters from the string.

Input

A string (1 \leq |S| \leq 255), consisting of lowercase Latin letters.

Output

Print the minimum number of deletions required to obtain sis from . If it is not possible, print .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading