fun main(arr: Array<String>) {
    var str = readLine()!!
    var prev = ""
    var ans = 0
    while (str.length > 0) {
        var tmp = ""
        if(str.substring((0 until 1)) == prev) {
            if(str.length == 1) {
                break
            } else {
                tmp = str.substring(0 until 2)
                str = str.drop(2)
                ans++
            }
        } else {
            tmp = str.substring(0 until  1)
            str = str.drop(1)
            ans++
        }
        prev = tmp
    }
    println(ans)
}

