fun main(args: Array<String>) {
    val s = readLine()!!
    var ans = 1
    var i = 1
    var before = s[0].toString()
    while (i < s.length) {
        ans++
        if (before == s[i].toString()) {
            before = s.substring(i, Math.min(i + 1, s.length - 1))
            i += 2
        } else {
            before = s[i].toString()
            i++
        }
    }
    println(ans)
}