#C2988. Minimum Changes to Palindrome

    ID: 46364 Type: Default 1000ms 256MiB

Minimum Changes to Palindrome

Minimum Changes to Palindrome

Given a string ( s ) consisting of lowercase alphabetic characters, determine the smallest number of character modifications required to convert ( s ) into a palindrome. A palindrome is a string that reads the same forward and backward. You are allowed to change any character to any other lowercase letter.

For example, if ( s = ) "abcdef", you can change 'a' to 'f', 'b' to 'e', and 'c' to 'd' (or vice versa) resulting in 3 changes to make it a palindrome.

inputFormat

Input is read from standard input (stdin). The input consists of a single line containing the string ( s ), which consists only of lowercase alphabetic characters.

outputFormat

Output the minimum number of changes required to make ( s ) a palindrome. The result is printed to standard output (stdout) as a single integer.## sample

ab
1