import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); String str = sc.next(); char c1 = 'c'; char c2 = 'w'; int count = 0; int ans = -1; int i = 0; while(i < str.length()){ if(str.charAt(i) == c1){ int a = i; while(i < str.length()){ if(str.charAt(i) == c2){ count++; } if(count == 2){ ans = i + 1 - a; break; } i++; } break; } i++; } System.out.println(ans); } }