line = STDIN.read.each_line.first.chomp

def count_hugs(str)
  if str.nil? || str.length == 0
    0
  else
    score = str[0] == str[-1] ? 0 : 1
    score + count_hugs(str[1..-2])
  end
end

puts count_hugs(line)
