str = gets.chomp
c0 = ['ii', 'ww', '()', ')(']
c1 = 'iw()'
c2 = ' iw'
l = str.size
res = (l/2).times.map{ |i|
  s = str[i] + str[l-1-i]
  if c0.include?(s) then 0
  elsif c1.include?(s[0]) || c1.include?(s[0]) then 1
  else 2
  end
}.reduce(:+)
res += c2.include?(str[l/2]) ? 0 : 1 if l % 2 == 1
p res