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 JavaScript (node.js v5.12) (judge verdict: Accepted)

// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    T = input[0];
  // console.log(T);
   
    var len = T.length;
  //console.log(len);
 var p = len%2;q = Math.floor(len/2);cnt=0;i=0;
// console.log (p,q);
 //console.log(T.substr(i,1));
// console.log(T.substr(len-1,1));
  
	  for(i = 0;i<q;i++)
	  {if (T.substr(i,1)==T.substr(len-1-i,1)){cnt=cnt+0;}
	  else{cnt++;}
		  
	  }
	  console.log(cnt);
	

	
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));