def main()
  string=gets
  half_length=(string.length/2).floor
  for i in 0..half_length
    if string[i] == string[-(i+1)]
      half_length-=1
    else
      half_length
    end
  end
  puts half_length
end
main()