import java.util.Scanner; public class Ccw { public static void main(String[] args) { Scanner s = new Scanner(System.in); String str = s.next(); s.close(); int left = 0,right = 0; left = str.indexOf("ccw"); right = str.length()-1-(left +1); System.out.println(Integer.min(left+1,right)); } }