word = 'ccw' s = input() word_index = s.index(word) print(min(word_index+1, len(s)-word_index-len(word)+1))