s = gets.chomp i = s.index("ccw") if i == nil puts 0 exit end count = 0 loop do i = s.index("ccw") break if i == nil m = s.length / 2 if i <= m s[0] = "" else s[-1] = "" end count += 1 end puts count