# 入力
s = gets.chomp

# 文字列を半分にする
b = s.size/2
moji = s.insert(b,",")
c = moji.split(",")

#2つを比べやすくする
mae = c[0]
ushiro = c[1]
ushiro =ushiro.reverse
d = [mae,ushiro]
e = d.all?{mae==ushiro}

# こたえ
if e == false
  puts b-mae.count(ushiro)
else
  puts 0
end
