s=gets.chomp.chars p [s.count('c')-1,s.count('w')].min