let s = stdin.ReadLine()
let n = s |> Seq.length
let rec f i p =
    if i=0 then p+1
    elif i<0 then p-1
    elif s.[i]=s.[i-1] then f (i-3) (p+2)
    else f (i-1) (p+1)
f (n-1) 0 |> stdout.WriteLine