#!/bin/sh

while true;
do
        read line1

        if [ -z "$line1" ]; then
                break
        fi

        charlen=`echo "$line1" | wc -c`
        halfLen=`echo "$charlen/2" | bc`
        hugCount=0

        for i in `seq 1 $halfLen`;
        do
                revNum=`echo "$charlen - $i" | bc`

                headLetter=`echo ${line1} | cut -c $i`
                tailLetter=`echo ${line1} | cut -c $revNum`
                if [ ! $headLetter = $tailLetter ]; then
                        hugCount=`echo "$hugCount + 1" | bc`
                fi
        done

        echo $hugCount

done