let s = read_line ()
let rec f i a p n = match String.length s - i with 0 -> a | -1 -> a - 1 | _ -> if n = 2 then f (i + 1) (a + 1) s.[i] 1 else if p = s.[i] then f (i + 2) (a + 1) p 2 else f (i + 1) (a + 1) s.[i] 1
let _ = f 0 0 ' ' 2 |> Printf.printf "%d\n"