S = input() i = 0 while S[i] == 'c': i += 1 print(min(i-1,len(S) - i))