import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); int c = S.indexOf("c"); if (c >= 0) { int w1 = S.indexOf("w", c + 1); if (w1 >= 0) { int w2 = S.indexOf("w", w1 + 1); if (w2 >= 0) { System.out.println(w2 - c +1); return; } } } System.out.println(-1); } }