inpu [x]       = [x]
inpu (x:y:z)
 | x == y      =   inpu $ y:z
 | otherwise   = x : (inpu $ y:z )

main = do
 _ <- getLine
 xs <- getLine
-- xs <- map read . words <$> getLine :: IO String
 print $ length$ inpu xs