using System; using System.Collections.Generic; using System.Linq; class Program { public void Solve() { string S = Console.ReadLine(); int wIdx = S.IndexOf('w'); int wCnt = S.Length - wIdx; int cCnt = S.Length - wCnt; Console.WriteLine(0 < (cCnt - 2) - (wCnt - 1) ? wCnt : cCnt - 1); } static void Main() { var solver = new Program(); solver.Solve(); } }