fun main(args: Array<String>) {
    val s = readLine()!!.toString()
    val n = s.length
    var sum = 0
    var before = ""
    var now = ""
    var i = 0
    while (i in 0 until n) {
        now += s[i]
        if (now != before) {
            sum++
            before = now
            now = ""
        }
        i++
    }
    println(sum)
}