let solve s_lst =
    let rec solve' lst result =
        match lst with
        | x1::x2::xs ->
            let next_result =
                if x1 <> x2 then result + 1
                else result
            solve' (x2::xs) next_result
        | _ -> result

    solve' s_lst 0

let () =
    let s_lst = stdin.ReadLine () |>
                List.ofSeq
    solve s_lst |> printfn "%d"  