import java.io.*; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main (String[] args) throws IOException { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int cs = 0 ; for (int i = 2 ; (s.substring(i-1,i)).equals("c"); i++){ cs = i; } int n = s.length(); int ans = Math.min(cs-1,n-cs); System.out.println(ans); } }