import java.util.*
 
fun main(args: Array<String>) {
  var arr = readLine()!!
  var length = arr.length - 1
  var count = 0
  var dp = arr.substring(0..0)
  var pos1 = 0
  var pos2 = 0

  while(pos1 < length) {
    /*
    println("======")
    println(pos1)
    println(pos2)
    */
    while(dp == arr.substring(pos1..pos2)) {
      pos2++  // 次の文字列を精査
    }
    count++
    dp=arr.substring(pos1..pos2)
    
    // 次回走査開始位置
    pos1=pos2+1
    pos2=pos1
  }
  println(count+1)
}