parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    s=chomp(readline())
    n=length(s)
    res=[1 for i in 1:n+1]
    if s[1]==s[2]
        res[2]+=1
    end
    for i in 3:n
        if s[i]==s[i-1]
            res[i+1]=res[i-2]+2
        else
            res[i+1]=res[i]+1
        end
    end
    println(res[n+1])
end
main()