#K92622. Minimum Changes to Palindrome

    ID: 38239 Type: Default 1000ms 256MiB

Minimum Changes to Palindrome

Minimum Changes to Palindrome

Given a string (s) of length (n), determine the minimum number of character alterations required to transform (s) into a palindrome. A palindrome is a string that reads the same backward as forward.

For example, for (s = \texttt{abca}), one alteration is needed to convert it into a palindrome (for instance, changing the last character to (\texttt{b}) to form (\texttt{abba})).

inputFormat

The input is given via standard input and consists of two lines:
1. The first line contains an integer (n) ((1 \leq n \leq 10^5)) representing the length of the string.
2. The second line contains the string (s) composed of lowercase English letters.

outputFormat

Output a single integer representing the minimum number of character alterations required to transform the string (s) into a palindrome. The output should be printed to standard output.## sample

5
abcba
0