let xs = stdin.ReadLine().ToCharArray()
let mutable i = 0
let mutable cnt = 0
let mutable cash = ' '
while i < xs.Length do
    cnt <- cnt + 1
    if cash = xs.[i] then
        cash <- ' '
        i <- i + 2
    else
        cash <- xs.[i]
        i <- i + 1
printfn "%d" cnt