{-# LANGUAGE OverloadedStrings #-}
import Data.Maybe
import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as VU

main = do
  s <- getLine
  print $ solve s

solve :: String -> Int
solve "" = 0
solve [_] = 1
solve (a:b:[]) = if a==b then 1 else 2
solve (a:b:c:cs) = if a==b then 2 + solve cs else 1 + solve (b:c:cs)
  
  
-- IO
readInt :: BS.ByteString -> Int
readInt = fst . fromJust . BS.readInt

getInt :: IO Int
getInt = readInt <$> BS.getLine

getIntList :: IO [Int]
getIntList = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

getIntVec :: Int -> IO (VU.Vector Int)
getIntVec n = VU.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine