local function str2tbl(s)
    -- limit of #s is approximately 999959
    local t = {string.byte(s, 1, #s)}
    local char = string.char
    for i=1, #t do
        t[i] = char(t[i])
    end
    return t
end
local S = str2tbl(io.read("l"))
local function solve()
    if #S == 1 then
        return 1
    elseif #S == 2 then
        return S[1] == S[2] and 1 or 2
    end
    local function strategy1()
        local p = S[1]
        local count = 1
        local i = 2
        while i <= #S do
            if S[i] == p then
                if i + 1 <= #S then
                    count = count + 1
                    p = p .. S[i]
                    i = i + 2
                else
                    return count
                end
            else
                count = count + 1
                p = S[i]
                i = i + 1
            end
        end
        return count
    end
    return strategy1()
end
print(solve())