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