fun main(arg: Array<String>) {
    var S = readLine()!!
    var L = S.length
    var M = mutableListOf<String>()
    var n = 0
    var m = -1
    while (n < L) {
        if (n == m) break
        m = n
        for (l in 1 .. L-n) {
            val s = S.substring(n, n+l)
            if (M.isEmpty() || M.last() != s) {
                M.add(s)
                n += l
                break
            }
        }
    }
    println(M.size)
}