let n = stdin.ReadLine()

let rec divide i length count=
    match i  with
    | _ when i = n.Length ->
        count
    | _ when i = n.Length + 1 ->
        count-1
    |_ ->
        let single = n.Substring(i,1)
        match length with
        | 2 ->
            divide (i+1) 1 (count+1)
        | 1 ->
            match n.Substring(i-1,1)=single with
            | true ->
                divide (i+2) 2 (count+1)
            |false ->
                divide (i+1) 1 (count+1)

divide 1 1 1 |> stdout.WriteLine 
