Line#778

Line

1 second
122.174 megabytes
Easy

Given a string consisting only of digits. In one move, you can delete any sequence of consecutive identical digits from this string. What is the minimum number of moves needed to delete the entire string?

Input

A single string of digits is given. The length of the string does not exceed characters.

Output

Print the minimum number of moves needed to delete the entire string.

Examples

Example 1

Loading
Loading