Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …
Problems
#851

~/algor $ cat problems/KkD6C7k8U57o

Make it a palindrome

Easy 1000 ms 64 MB 14%
Share

A string of lowercase Latin letters is given. In one operation you may replace any one letter of the string with any other letter. What is the smallest number of operations needed to turn into a palindrome (a string that reads the same from left to right and from right to left)?

The string abcdba: letters are compared in pairs from the ends, only the pair c and d differs

Input

One line contains the string .

Output

One integer — the smallest number of operations.

Note


consists of lowercase Latin letters (a–z) only

Examples

Input #1
abcdba
Output #1
1
Input #2
racecar
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.