fun main(args : Array<String>) {
    val S = readLine()!!
    var index = 0
    var current = ""

    var answer = 0
    var before = ""
    while (index < S.length) {
        current += S[index]
        if (before == current) {
        } else {
            before = current
            current = ""
            answer++
        }
        index++
    }
    println(answer)
}