module Main where

import Data.Maybe (fromJust)
import Data.List
import Control.Monad
import qualified Data.ByteString.Char8 as BS

import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM

bytestr2Int = fst . fromJust . BS.readInt
getInt = bytestr2Int <$> BS.getLine
getIntL_H = map bytestr2Int. BS.words <$> BS.getLine
getIntL_V n = replicate n $ getInt
getInt2D n = replicate n $ getIntL_H

main :: IO ()
main = do
    _ <- getInt
    ns <- getLine
    print $ length . combine $ ns

combine [x] = [x]
combine (x:y:xs) = if x == y
                      then combine $ x:xs
                      else x:(combine (y:xs))

