open System.Text.RegularExpressions let ``No.436 ccw``() = let len arg (reg:Regex) = match (reg.IsMatch arg) with | true -> reg.Matches(arg).[0].Groups.[0].Value.Length | false-> 0 let s = stdin.ReadLine() let lenC = Regex( "^(c+)" ) |> len s let lenW = Regex( "(w+)$" ) |> len s match lenC <= lenW with | true -> lenC-1 | false-> lenW |> stdout.WriteLine () ``No.436 ccw``()