import qualified Data.ByteString.Char8 as BS

main = do
    ni <- BS.getLine 
    let n = read $ BS.unpack ni :: Int
    slime_i <- BS.getLine 
    let slime = BS.unpack slime_i
    putStrLn $ show $ check (head slime) (tail slime)

check :: Char -> [Char] -> Int
check prev (x:[]) = answer
    where answer = if prev == x
            then 1
            else 2
check prev (x:xs) = answer + (check x xs)
    where answer = if prev == x
            then 0
            else 1