AdvancedRating 1700
Fewest Palindrome Cuts
Cut the string into pieces so that every piece is a palindrome. Print the fewest cuts needed.
Input
One string (length ≤ 1500).
Output
One integer.
Sample 1
Input
aab
Output
1
Sample 2
Input
a
Output
0
Output appears here