Time limit
2s
Memory limit
128 MB
A palindrome is a string that reads the same from left to right and from right to left.
You may use the following operations to turn a string into a palindrome.
Operations 1, 2, and 3 may be used any number of times. Operation 4 may be used at most once.
Given a string, find the minimum number of operations needed to make it a palindrome.
The first line contains a string. It consists only of lowercase English letters, and its length is at most 50.
Print the minimum number of operations needed.