import java.util.*

const val MOD = 1000000007L
const val INF = Long.MAX_VALUE - 1

fun main(args: Array<String>) {
    val s = readList().first()

    var count = 0
    var prev = ""
    var now = ""
    s.forEach {
        now += it
        if (prev == now) {
        } else {
//            println(prev)
            prev = now
            now = ""
            count++
        }
    }
    println(count)
}

fun readList() = readLine()!!.split(' ')


inline fun Int.rep(start: Int = 0, shiftLast: Boolean = false, body: (Int) -> Unit) {
    for (i in start until if (shiftLast) this + start else this) {
        body(i)
    }
}

inline fun Long.rep(start: Long = 0, shiftLast: Boolean = false, body: (Long) -> Unit) {
    for (i in start until if (shiftLast) this + start else this) {
        body(i)
    }
}

fun <K, V> Map<K, V>.toMutableMap(): MutableMap<K, V> {
    return HashMap(this)
}