s = gets.chomp i = s.index("ccw") if i == nil puts 0 exit end first = 0 last = 0 fs = s.dup ls = s.dup while fs.index("ccw") != nil fs[0] = "" first += 1 end while ls.index("ccw") != nil ls[-1] = "" last += 1 end puts [first, last].min