Problem:
Score : 200 points

Problem Statement

Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.

Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Constraints

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Print the minimum number of hugs needed to make S palindromic.

Sample Input 1

redcoder

Sample Output 1

1

For example, we can change the fourth character to o and get a palindrome redooder.

Sample Input 2

vvvvvv

Sample Output 2

0

We might need no hugs at all.

Sample Input 3

abcdabc

Sample Output 3

2

Solution in PHP (5.6.30) (judge verdict: Accepted)

<?php
$a = trim(fgets(STDIN));  

$arr = str_split($a);
$cnt = count($arr);

if ($cnt % 2 === 0) {               //偶数時
  $mae = $cnt /2;
  $mae2 =0- $mae;
  $ato = $mae - 1;
  $result1 = array_slice($arr , 0, $mae);
  $result2 = array_slice($arr , $mae);
  $result3 = array_reverse($result2);
  $s = implode($result1);
  $t = implode($result3);

      $diff = array_diff_assoc($result1, $result3);
      $f = count($diff);
      echo $f;
    
} else {                     //奇数時
  $ass = $cnt - 1;
  $mae = $ass /2;
  $ato = $mae + 1;
  $result1 = array_slice($arr , 0, $mae);
  $result2 = array_slice($arr , $ato);
  $result3 = array_reverse($result2);
  $s = implode($result1);
  $t = implode($result3);

      $difs = array_diff_assoc($result1, $result3);
      $f = count($difs);
      echo $f;

}
?>