using System; using System.Collections.Generic; using System.Linq; public class yukicoder { public static void Main() { string s = Console.ReadLine(); int c = s.IndexOf("w"); int w = s.Length - c; if(c > w) Console.WriteLine(w); else Console.WriteLine(c - 1); } }