import java.io.*
import java.util.*
import kotlin.collections.*
import kotlin.math.*


fun solve() {
    val s = kin.str()
    var last = ""
    var ans = 0
    var cur = ""
    for (ch in s) {
        cur += ch
        if (cur != last) {
            last = cur
            cur = ""
            ans++
        }
    }
    kout.println(ans)
}

fun main() {
    kout.use { solve() }
}

var kin = InputReader(getInput())
val kout = PrintWriter(System.out)

class InputReader(stream: InputStream) {
    private val reader = BufferedReader(InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer? = null

    fun str(): String {
        while (tokenizer?.hasMoreTokens() != true) {
            tokenizer = StringTokenizer(reader.readLine())
        }
        return tokenizer!!.nextToken()
    }

    fun <R> list(n: Int, parse: (String) -> R): MutableList<R> {
        return (1..n).map { parse.invoke(str()) }.toMutableList()
    }

    fun int() = str().toInt()
    fun listInt(n: Int) = list(n) { it.toInt() }
    fun long() = str().toLong()
    fun listLong(n: Int) = list(n) { it.toLong() }
}

fun getInput(): InputStream {
    val inputFile = try {
        System.getProperty("compet.input")
    } catch (ex: Exception) {
        null
    } ?: return System.`in`

    return FileInputStream({}::class.java.classLoader.getResource(inputFile).file)
}

