let () =
    let main () =
        let n = int_of_string (read_line ()) in
        let s = read_line () ^ "$" in
        let rec loop i prev acc =
            if i > n then acc else loop (i + 1) s.[i] (acc + if prev = s.[i] then 0 else 1)
        in
        Printf.printf "%d\n" (loop 1 s.[0] 0)
    in
    main ()